stalonetray-0.8.3/0000755000175000017500000000000012475445167013156 5ustar varunvarunstalonetray-0.8.3/stalonetray.xml.in0000644000175000017500000005101512461516774016652 0ustar varunvarun Roman Dubtsov stalonetray 1 stalonetray stalonetray @VERSION_STR@ User Commands stalonetray stand-alone system tray (notification area) implementation. This document covers @VERSION_STR@ version of stalonetray. stalonetray option DESCRIPTION Stalonetray is a stand-alone system tray (notification area) for X Window System/X11 (e.g. XOrg or XFree86). It has minimal build and run-time dependencies: an X11 lib only. Complete XEMBED support is under development. Stalonetray works with virtually any EWMH-compliant window manager. The behaviour and the look of stalonetray can be configured either via command line options or via configuration file. As usual, command-line options have precedence over options that are specified in the configuration file. Names of command line parameter may have two variants: short () and long (). Write value or value to pass a value using the short name of a parameter; to pass a value using a long name, write value or =value. All flag-like parameters have optional boolean value that when ommited is assumed to be "true". Write "true", "yes", "1", for positive boolean values, and "false", "no", "0" for negative ones. Default configuration file is $HOME/.stalonetrayrc. A configuration file contains case-insensetive keyword-argument pairs, one per line. Lines starting with '#' and empty lines are ignored. Alternatively, confiuration file can specified via or command-line options. Below is the list of possible command line/configuration file options. Options starting with hyphens are command-line parameters others are configuration file keywords. Options that are new in @VERSION_STR@ version are marked with "NEW in @VERSION_STR@". OPTIONS color color color Use color for tray`s background. color can be specified as an HTML hex triplet or as a name from rgb.txt (note that '#' must be quoted). Default value: #777777. filename filename Read configuration from filename instead of default $HOME/.stalonetrayrc. decspec decspec decspec Specify visiblie tray window decorations. Possible values for decspec are: all, title, border, none (default). display display Use X display display. mode mode Set dockapp mode, which can be either simple for e.g. OpenBox, wmaker for WindowMaker, or none (default). level level level Enable fuzzy edges of tray window and set fuzziness level which can range from 0 (disabled, default) to 3. When ommited, the value of level defaults to 2. geometry_spec geometry_spec Set tray`s initial geometry to geometry_spec, specified in standard X notation: widthxheight[+x[+y]], where width and height are specified in icon slot multiples. Default value: 1x1+0-0. gravity gravity Specify icon positioning gravity (eigher N, S, W, E, NW, NE, SW, SE). Grow gravity specifies directions in which the tray's window may grow. For instance, if you specify NW the tray's window will grow down vertically and to the right horizontally (these are sides that are opposite to upper-left or North-West corner of the window); with W the tray's window will grow horizontally to the left side only, and it will vertically grow both upwards and downwards maintaining position of its center. Please note that the latter behaviour is new in 0.8. Default value: NW. gravity gravity Specify icon positioning gravity (either NW, NE, SW, SE). If you specify, e.g SW, then icons will appear starting from the lower-left corner of the tray's window. Default value: NW. n n n Set default icon size to n. Default value: 24. Minimum: 16. Show help message. level level Set the amount of info to be output by stalonetray. Possible values for level: err (default), info, and trace. For the trace option to be available, stalonetray must be configured with at build-time. kludge,kludge Enable specific kludges to work around non-conforming WMs and/or stalonetray bugs. Argument is a comma-separated list of: fix_window_pos — fix tray window position on erroneous moves by WM force_icons_size — ignore resize events on all icons; force their size to be equal to use_icons_hints — use icon window hints to determine icon size geometry_spec geometry_spec Set tray`s maximal geometry to geometry_spec Default value: 0x0, no limit. bool Do not shrink tray window back after icon removal. Useful when tray is swallowed by another window like FvwmButtons. Default value: false. bool Use the parent's window as a background of the tray's window. Default value: false. path_to_xpm Use the pixmap from an XPM file specified by path_to_xpm for the tray`s window background (pixmap will be tiled to fill the entire window). name name Remote control/click. When this option is specified, stalonetray sends a fake click to the icon with a window named name and exits. The icon is searched for in the currently active tray for the current screen. By default, stalonetray sends a single click with the 1st mouse button to the center of the icon. See the options below for additional information on how to alter the defaults. n Sets the remote click's button number to n (in the X11 numbering order). xxy Sets the remote click's position. type Sets the remote click's type. Possible values: single and double. n n n Set grid slot size to n, which cannot be less then . By default, the slot size is the same as the icon size. mode mode Set scrollbar mode. Possible values: vertical, horizontal, all, or none (default). Scrollbars appear as additional space at tray borders that can be clicked to scroll icon area. Mouse wheel also works. mode mode Set scrollbars highlight mode. Possible values: a color spec, or disable. n n Set scrollbar size to n pixels. By default, the size is 1/4 of . n n Set scrollbar step to n pixels. Default is 1/2 of . bool Hide tray`s window from the taskbar. Default value: false. bool Make tray`s window sticky across multiple desktops/pages. Default value: false. bool Set tinting color. Default value: white. level Set tinting level. Default value: 0 (tinting disabled). bool Enable root transparency. Default value: false. bool Use vertical layout of icons (horizontal is used by default). layer layer Sets the EWMH-compliant layer of tray`s window. Possible values for layer: bottom, normal, top. Default value: normal. mode mode Enable window struts for tray window (to avoid covering of tray window by maximized windows). Mode defines to which screen border tray window will be attached. It can be either top, bottom, left, right, none, or auto (default). type type Sets the EWMH-compliant type of tray`s window. Possible values for type: desktop, dock, normal, toolbar, utility. Default value: dock. bool Operate on X server synchronously (SLOW, turned off by default). DEPRECATIONS As of stalonetray 0.8, the following command line and configuration file parameters are deprecated: Please use instead. Please use instead. Please use instead. Please use with use_icon_hints parameter instead. FILES $HOME/.stalonetrayrc — default configuration file. BUGS There are some, definetly. If you have found a bug, please try to reproduce it with the log level set to trace and send the log file to me: busa_ru@users.sourceforge.net. If you need support, the best way to get it is also to e-mail me directly. If you have installed stalonetray from a distribution repository, you can also file a bug in the respective bug tracking database. stalonetray-0.8.3/AUTHORS0000644000175000017500000000005610751351740014213 0ustar varunvarunRoman Dubtsov stalonetray-0.8.3/configure.ac0000644000175000017500000001167712475441207015447 0ustar varunvarun# $Id: configure.ac 585 2015-03-04 10:56:39Z busa_ru $ AC_INIT(stalonetray, 0.8.3) AC_CONFIG_SRCDIR(src/main.c) AM_CONFIG_HEADER(src/config.h) AM_INIT_AUTOMAKE dnl ============ General ============= AC_PROG_CC AC_GNU_SOURCE AC_CHECK_HEADERS([ctype.h],,[AC_MSG_FAILURE([ctype.h is not found.])]) AC_CHECK_HEADERS([errno.h],,[AC_MSG_FAILURE([errno.h is not found.])]) AC_CHECK_HEADERS([signal.h],,[AC_MSG_FAILURE([signal.h is not found.])]) AC_CHECK_HEADERS([stdio.h],,[AC_MSG_FAILURE([stdio.h is not found.])]) AC_CHECK_HEADERS([stdlib.h],,[AC_MSG_FAILURE([stdlib.h is not found.])]) AC_CHECK_HEADERS([string.h],,[AC_MSG_FAILURE([string.h is not found.])]) AC_CHECK_HEADERS([time.h],,[AC_MSG_FAILURE([time.h is not found.])]) AC_CHECK_HEADERS([unistd.h],,[AC_MSG_FAILURE([unistd.h is not found.])]) AC_CHECK_HEADERS([libgen.h]) dnl ============ General ============= dnl ========== Backtrace ============= AC_TRY_LINK([#include #include ], [void *array[10]; size_t size; size = backtrace(array, 10); backtrace_symbols_fd(array, size, 0); ], [ac_cv_var_backtrace=yes], [ac_cv_var_backtrace=no]) if test x$ac_cv_var_backtrace = xyes; then AC_DEFINE(HAVE_BACKTRACE, 1, [System has usable backtrace implementation.]) else AC_TRY_LINK([#include ], [printstack(0);], [ac_cv_var_printstack=yes], [ac_cv_var_printstack=no]) if test x$ac_cv_var_printstack = xyes; then AC_DEFINE(HAVE_PRINTSTACK, 1, [System has usable printstack implementation.]) fi fi dnl ========== Backtrace ============= dnl ============= X11 ================ no_x="" AC_PATH_XTRA if test "x$no_x" = "xyes"; then echo "X11 libraries/headers could not be found." echo "If they are definetly installed, use" echo " --x-includes and --x-libraries to set the paths." echo echo "Aborting" echo exit 1 fi dnl AC_SUBST(x_includes) dnl AC_SUBST(x_libraries) dnl ============= X11 ================ dnl ========= libxpm presence ac_cv_xpm_supported=yes AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, , [ac_cv_xpm_supported=no], [$X_LIBS]) case "$ac_cv_xpm_supported" in yes) AC_DEFINE(XPM_SUPPORTED, 1, [enable XPM background support]) ;; *) ;; esac feature_list="XPM:$ac_cv_xpm_supported" dnl ========= KDE icons support AC_ARG_ENABLE(native-kde, [ --disable-native-kde disable native kde tray icons support], [ac_cv_no_native_kde="$enableval"], [ac_cv_no_native_kde="yes"]) AC_ARG_ENABLE(debug, [ --enable-debug enable debugging output\checks], [ac_cv_debug="$enableval"], [ac_cv_debug="yes"]) AC_ARG_ENABLE(events-trace, [ --enable-events-trace enable full event trace (debug)], [ac_cv_events_trace="$enableval"], [ac_cv_events_trace="yes"]) AC_ARG_ENABLE(embedding-confirmation-delay, [ --enable-embedding-confirmation-delay delay sending of embedding confirmation (debug)], [ AC_DEFINE(DELAY_EMBEDDING_CONFIRMATION, 1, [delay sending of embedding confirmation]) LDFLAGS="$LDFLAGS -lpthread" ], []) AC_ARG_ENABLE(dump-win-info, [ --enable-dump-win-info use xprop/xwininfo to dump icon window info], [ac_cv_dump_win_info="$enableval"], [ac_cv_dump_win_info="yes"]) AC_ARG_ENABLE(graceful-exit, [ --enable-graceful-exit use non-portable hack to exit gracefuly on signal], [ac_cv_graceful_exit="$enableval"], [ac_cv_graceful_exit="yes"]) case "$ac_cv_debug" in yes) AC_DEFINE(DEBUG, 1, [enable debugging code]) if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -g" else echo "INFO: Since you use non-gcc compiler, please enable generation of debug info" echo " for your compiler manually (via CFLAGS shell variable)" fi ;; *) ;; esac feature_list="$feature_list DEBUG:$ac_cv_debug" kde_tray_support="kde_tray.o" case "$ac_cv_no_native_kde" in no) AC_DEFINE(NO_NATIVE_KDE, 1, [disable native kde tray icons support]) kde_tray_support="" ;; *) ;; esac AC_SUBST(kde_tray_support) case "$ac_cv_dump_win_info" in yes) AC_DEFINE(ENABLE_DUMP_WIN_INFO, 1, [use xprop/xwininfo to dump icon window info]) ;; *) ;; esac case "$ac_cv_graceful_exit" in no) ;; *) AC_DEFINE(ENABLE_GRACEFUL_EXIT_HACK, 1, [use non-portable hack to exit gracefuly on signal]) ;; esac case "$ac_cv_events_trace" in yes) AC_DEFINE(TRACE_EVENTS, 1, [enable full event trace (debug)]) ;; *) ;; esac feature_list="$feature_list KDE:$ac_cv_no_native_kde" CPPFLAGS="$CPPFLAGS -DFEATURE_LIST='\"$feature_list\"'" dnl ============ Features ============ AC_OUTPUT([ Makefile src/Makefile ]) echo "*" echo "* Debug : $ac_cv_debug" if test "x$ac_cv_debug" = "xyes" -a "x$GCC" != "xyes"; then echo "* Since you are not using gcc compatible compiler, please" echo "* set debug CFLAGS manually (if you want to)" fi echo "* Native KDE support : $ac_cv_no_native_kde" echo "* XPM background support : $ac_cv_xpm_supported" echo "* Graceful exit support : $ac_cv_graceful_exit" echo "*" stalonetray-0.8.3/README0000644000175000017500000000144312461504712014023 0ustar varunvarun STAnd aLONE TRAY DESCRIPTION: the stalonetray is a STAnd-aLONE system TRAY (notification area). It has minimal build and run-time dependencies: the Xlib only. The XEMBED support is planned. Stalonetray runs under virtually any window manager. To start using stalonetray, just copy stalonetrayrc.sample to ~/.stalonetrayrc. It is well-commented and should suffice for a quick start. Since 0.3 we have a pretty manpage. In case of problems, do not hesitate to contact the author directly. BUILD-DEPS: Xlib, libc, cc. LICENSE: GPL (see COPYING). REPORTING BUGS: If you have found a bug, try to reproduce it with debug level set to trace (see the manpage) and send the log file to the e-mail listed in AUTHORS file. HOW TO HELP: See TODO file and TODOs, XXXs and FIXMEs in sources if you want to. stalonetray-0.8.3/TODO0000644000175000017500000001300112461504712013624 0ustar varunvarun+ Each icon must have a newly created parent window, which matches its dimentions (for ease of move and for them to be centered ?). + Anvanced grow + Reorganize settings (and vars) - Make use of resources (WONTDO) + rc file + Need to handle unusual sizes of "icons" (and resolve when to force constraints) + Make satray survive even if window suddenly dissapears (during some operation, when destroy\unmap was not handled) + KDE tray implementation (solves previous problem) + Handle tray icon move/resize + Simplify rc file syntax/re-reorganize settings + main.c cleanup + update transparent/parent background on icon move/resize + review DBG() calls in accordance with doc/DEBUG-LEVELS + reacquire tray selection after loss (if holder exits) (update sample rc(done)) + find and fix typos + fix (almost all) warnings with -Wall + .spec file for building rpms + man page + tray grow with wnd deco for 0.4 + default values in the manpage, MWM/EWMH compliancy must be noted + ontop/onbottom/normal (wnd_layer param) + xorg7 build troubles + more flexible wnd deco specification + make use of ewmh spec (_NET_WM_STATE_SKIP_PAGER, _NET_WM_WINDOW_TYPE_DOCK and friends) + all configure.in needs review (refuse to build if something goes wrong) + update DBG so that it does not require C99 + *wm tests (pwm(2), e17 have some issues): + WMaker (everything works) + Fvwm (for sure) + PWM(1) (no_{title,border} do not work) + E17 (the same =() + something has happened to vertical layout (all works) + tests on sf cf + now stalonetray can be build with Sun ONE 8 C compiler =) (because it's sources conform to C90 specs) + change status to beta =) for 0.5(unreleased, renamed to 0.6) + code cleanup (again :() (REVIEW layout.c very thoroughly!!!) + fix geometry issues + GNUisms in debug.h + icons are not aligned properly inside their mid-parents + basename can be either in libgen.h or in string.h o_O : XPG ver from libgen.h was chosen + update manpages, etc (docbook for documentation ?) + fix default rc file name + backtrace in configure.in is not detected ? + make boolean cfg file opts to have _optional_ argument + make permanent behaviour default and remove it from configuration + default values in documentation + validate stalonetray.xml + collect icons on startup (test, KDE icons issue) needs XEMBED ?!!! + Full XEMBED implementation (?) + issue with composite extension on (seq1,2) + version info + pixmap bg + check rc keyword names for concistency and update stalonetrayrc.sample + test non-debug version + test with LARGE pixmap + PORTING + fix the website for IE (and colors) for 0.7 - DOXYGEN documentation (WONTDO, 0.8?) - one state instead of multiple flags for icons (WONTDO) - split main.c into: signals.c events.c main.c (WONTDO) - support for WINE icons (WONTDO: isn't it WINE problem?) + consistent naming scheme for funcs + shrink back mode + reconsider API + improve X11-using code + params for boolean cmd line parameters (reconsider cmd line params and rc file directives) ??? (--skip-taskbar=true) + indicate parsing errors (make them fatal?) + comments + bg tinting (with fade out) + wmaker mode (SORTOFWORKS) + fall back to legacy KDE icons handling scheme when list of icons is not available + withdrawn mode should be configurable + XEMBED test suite ? + rethink command line params names + merge changes from 0.6 bugfixes branch (x86_64 patches pending) (size hints handling?) + layout _needs_ fixin` (TEST!!!!, seq1) (HOORAY!!!!!) + automatic version string in _all_ documentation + update README/docs + sanitize DBG levels for 0.7.6 + ensure that x11_ok() called at all exit paths from x11-calling functions + startup issues (collect existing icons) - focus issue in Wmaker for 0.8 + slot size vs. icon size + review ignore_icon_resize usage + all dims must be given in slots not in pixels + scrollable tray area? (see http://wnd.katei.fi/weblog/entry-7) + need repeater mode + support for mouse wheel (scroll vertically if mousewheeling over vert sb and horizontally if over horz sb; default to orientation otherwise) + strut WM hints (requires Xinerama?) + fix geometry code + fix wmaker docking mode (--widthrawn=off/simple/wmaker) - proper dockapp behaviour in WM + add --kludge command line param that turns kludges on/off + move respect icon hints under this category + geometry bugs (wrong placement) (CANTREPRODUCE?) + valgrind + color background + xpm background + xpm background + transparency + remote interface (via send event to tray selection manager) + profile the code + powertop; fix event loop to block if there are no events and no scrolling + proper handling of signals required!!! + SIGUSR1 handing is OK (its for debug only anyway) + termination signals wont be handled to avoid hacks... + fix complaint about icon placement in WM dockapp mode + fix complaint about window layer under WM (CANTREPRODUCE, Window Maker 0.92.0) + rework DBG/ERR/DIE + update sample RC + proper formatting of log lines (date + remove location) + fix bug with resize for 0.8.1,2,../0.9 - systray 0.3 spec (VISUAL) - proper dockapp behaviour in WM - profile the code - gprofile; use array in icons.c instead of list - RENDER implementation of tinting/compositing, take implementation from rxvt - sanitize x11 calls: check return values instead of relying on x11_ok() whenever possible - track size changes of the icons that failed to fit into the tray - rework root transparency code (handle cases when root pmap size is less than root window; take implementation from urxvt) - restructure command line params and reduce their count - rework command line interface stalonetray-0.8.3/aclocal.m40000644000175000017500000011362312475441240015010 0ustar varunvarun# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR stalonetray-0.8.3/Makefile.am0000644000175000017500000000260512461516700015200 0ustar varunvarunSUBDIRS=src man_MANS=stalonetray.1 doc_DIST=stalonetrayrc.sample stalonetray.1 stalonetray.xml stalonetray.html EXTRA_DIST=$(doc_DIST) stalonetray.spec stalonetray.xml.in stalonetrayrc.sample.in # $(debian_DIST) MAINTAINERCLEANFILES=stalonetray.1 stalonetray.html stalonetray.spec stalonetray.xml stalonetrayrc.sample ChangeLog dist_hook: stalonetray.1 stalonetray.html stalonetray.xml: stalonetray.xml.in configure.ac stalonetrayrc.sample: stalonetrayrc.sample.in configure.ac stalonetray.spec: stalonetray.spec.in configure.ac stalonetray.xml \ stalonetrayrc.sample \ stalonetray.spec: VERSION_STR=`echo @VERSION@ | sed 's/\([^\.]*\.[^\.]*\)\..*/\1/'`; \ cat $< | sed "s/@VERSION_STR@/$$VERSION_STR/g" > $@ stalonetray.1: stalonetray.xml # xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl stalonetray.xml xsltproc /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl stalonetray.xml stalonetray.html: stalonetray.xml # xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl stalonetray.xml > stalonetray.html xsltproc /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl stalonetray.xml > stalonetray.html ChangeLog: svn update svn2cl --linelen=90 --break-before-msg=2 #docdir=$(datadir)/doc/$(PACKAGE)/ #install-data-local: # mkdir -p $(DESTDIR)/$(docdir) # cp AUTHORS BUGS COPYING NEWS README stalonetrayrc.sample $(DESTDIR)/$(docdir) stalonetray-0.8.3/stalonetrayrc.sample0000644000175000017500000001300112475441262017236 0ustar varunvarun# vim:filetype=config:tw=80:et # # This is sample ~/.stalonetrayrc, resembling default configuration. # Remember: command line parameters take precedence. # # Directives introduced in 0.8 are marked with "NEW in 0.8" # #################################################################### # # stalonetray understands following directives # #################################################################### # background # color can be specified as an HTML hex triplet or # as a name from rgb.txt, note that '#' must be quoted background "#777777" # decorations # set trays window decorations; possible values for # decspec are: all, title, border, none decorations none # display # as usual # dockapp_mode # set dockapp mode, which can be either simple (for # e.g. OpenBox, wmaker for WindowMaker, or none # (default). NEW in 0.8. dockapp_mode none # fuzzy_edges [] # enable fuzzy edges and set fuzziness level. level # can be from 0 (disabled) to 3; this setting works # with tinting and/or transparent and/or pixmap # backgrounds fuzzy_edges 0 # geometry # tray's geometry in standard X notation; width and # height are specified in slot_size multiples geometry 1x1+0+0 # grow_gravity # one of N, S, E, W, NW, NE, SW, SE; tray will grow # in the direction opposite to one specified by # grow_gravity; if horizontal or vertical # direction is not specified, tray will not grow in # that direction grow_gravity NW # icon_gravity # icon placement gravity, one of NW, NE, SW, SE icon_gravity NW # icon_size # specifies dimensions of typical icon slot icon_size 24 # log_level # controls the amount of logging output, level can # be err (default), info, or trace (enabled only # when stalonetray configured with --enable-debug) # NEW in 0.8. log_level err # kludges kludge[,kludge] # enable specific kludges to work around # non-conforming WMs and/or stalonetray bugs. # NEW in 0.8. Argument is a # comma-separated list of # * fix_window_pos - fix tray window position on # erroneous moves by WM # * force_icons_size - ignore resize events on all # icons; force their size to be equal to # icon_size # * use_icon_hints - use icon window hints to # dtermine icon size # max_geometry # maximal tray dimensions; 0 in width/height means # no limit max_geometry 0x0 # no_shrink [] # disables shrink-back mode no_shrink false # parent_bg [] # whether to use pseudo-transparency # (looks better when reparented into smth like FvwmButtons) parent_bg false # pixmap_bg # use pixmap from specified xpm file for (tiled) background # pixmap_bg /home/user/.stalonetraybg.xpm # scrollbars # enable/disable scrollbars; mode is either # vertical, horizontal, all or none (default) # NEW in 0.8. scrollbars none # scrollbars-size # scrollbars step in pixels; default is slot_size / 4 # scrollbars-step 8 # scrollbars-step # scrollbars step in pixels; default is slot_size / 2 # scrollbars-step 32 # slot_size # specifies size of icon slot, defaults to # icon_size NEW in 0.8. # skip_taskbar [] # hide tray`s window from the taskbar skip_taskbar true # sticky [] # make a tray`s window sticky across the # desktops/pages sticky true # tint_color # set tinting color tint_color white # tint_level # set tinting level; level ranges from 0 (disabled) # to 255 tint_level 0 # transparent [] # whether to use root-transparency (background # image must be set with Esetroot or compatible utility) transparent false # vertical [] # whether to use vertical layout (horisontal layout # is used by default) vertical false # window_layer # set the EWMH-compatible window layer; one of: # bottom, normal, top window_layer normal # window_strut # enable/disable window struts for tray window (to # avoid converting of tray window by maximized # windows); mode defines to which screen border tray # will be attached; it can be either top, bottom, # left, right, none or auto (default) window_strut auto # window_type # set the EWMH-compatible window type; one of: # desktop, dock, normal, toolbar, utility window_type dock # xsync [] # whether to operate on X server synchronously (SLOOOOW) xsync false stalonetray-0.8.3/stalonetray.html0000644000175000017500000005734012475441267016417 0ustar varunvarun stalonetray

Name

stalonetray — stand-alone system tray (notification area) implementation. This document covers 0.8 version of stalonetray.

Synopsis

stalonetray [option...]

DESCRIPTION

Stalonetray is a stand-alone system tray (notification area) for X Window System/X11 (e.g. XOrg or XFree86). It has minimal build and run-time dependencies: an X11 lib only. Complete XEMBED support is under development. Stalonetray works with virtually any EWMH-compliant window manager.

The behaviour and the look of stalonetray can be configured either via command line options or via configuration file. As usual, command-line options have precedence over options that are specified in the configuration file.

Names of command line parameter may have two variants: short (-o) and long (--option). Write -ovalue or -o value to pass a value using the short name of a parameter; to pass a value using a long name, write --option value or --option=value. All flag-like parameters have optional boolean value that when ommited is assumed to be "true". Write "true", "yes", "1", for positive boolean values, and "false", "no", "0" for negative ones.

Default configuration file is $HOME/.stalonetrayrc. A configuration file contains case-insensetive keyword-argument pairs, one per line. Lines starting with '#' and empty lines are ignored. Alternatively, confiuration file can specified via -c or --config command-line options.

Below is the list of possible command line/configuration file options. Options starting with hyphens are command-line parameters others are configuration file keywords. Options that are new in 0.8 version are marked with "NEW in 0.8".

OPTIONS

-bg color, --background color, background color

Use color for tray`s background. color can be specified as an HTML hex triplet or as a name from rgb.txt (note that '#' must be quoted). Default value: #777777.

-c filename, --config filename

Read configuration from filename instead of default $HOME/.stalonetrayrc.

-d decspec, --decorations decspec, decorations decspec

Specify visiblie tray window decorations. Possible values for decspec are: all, title, border, none (default).

-display display, display display

Use X display display.

--dockapp-mode [mode], dockapp_mode [mode]

Set dockapp mode, which can be either simple for e.g. OpenBox, wmaker for WindowMaker, or none (default).

-f [level], --fuzzy-edges [level], fuzzy_edges [level]

Enable fuzzy edges of tray window and set fuzziness level which can range from 0 (disabled, default) to 3. When ommited, the value of level defaults to 2.

--geometry geometry_spec, geometry geometry_spec

Set tray`s initial geometry to geometry_spec, specified in standard X notation: widthxheight[+x[+y]], where width and height are specified in icon slot multiples. Default value: 1x1+0-0.

--grow-gravity gravity, grow_gravity gravity

Specify icon positioning gravity (eigher N, S, W, E, NW, NE, SW, SE). Grow gravity specifies directions in which the tray's window may grow. For instance, if you specify NW the tray's window will grow down vertically and to the right horizontally (these are sides that are opposite to upper-left or North-West corner of the window); with W the tray's window will grow horizontally to the left side only, and it will vertically grow both upwards and downwards maintaining position of its center. Please note that the latter behaviour is new in 0.8. Default value: NW.

--icon-gravity gravity, icon_gravity gravity

Specify icon positioning gravity (either NW, NE, SW, SE). If you specify, e.g SW, then icons will appear starting from the lower-left corner of the tray's window. Default value: NW.

-i n, --icon-size n, icon_size n

Set default icon size to n. Default value: 24. Minimum: 16.

-h, --help

Show help message.

--log-level level, log_level level

Set the amount of info to be output by stalonetray. Possible values for level: err (default), info, and trace. For the trace option to be available, stalonetray must be configured with --enable-debug at build-time.

--kludges kludge [,kludge...]

Enable specific kludges to work around non-conforming WMs and/or stalonetray bugs. Argument is a comma-separated list of:

  • fix_window_pos — fix tray window position on erroneous moves by WM

  • force_icons_size — ignore resize events on all icons; force their size to be equal to icon_size

  • use_icons_hints — use icon window hints to determine icon size

--max-geometry geometry_spec, max_geometry geometry_spec

Set tray`s maximal geometry to geometry_spec Default value: 0x0, no limit.

--no-shrink, no_shrink [bool]

Do not shrink tray window back after icon removal. Useful when tray is swallowed by another window like FvwmButtons. Default value: false.

-p, --parent-bg, parent_bg [bool]

Use the parent's window as a background of the tray's window. Default value: false.

--pixmap-bg path_to_xpm, pixmap_bg path_to_xpm

Use the pixmap from an XPM file specified by path_to_xpm for the tray`s window background (pixmap will be tiled to fill the entire window).

-r name, --remote-click-icon name

Remote control/click. When this option is specified, stalonetray sends a fake click to the icon with a window named name and exits. The icon is searched for in the currently active tray for the current screen. By default, stalonetray sends a single click with the 1st mouse button to the center of the icon. See the options below for additional information on how to alter the defaults.

--remote-click-button n

Sets the remote click's button number to n (in the X11 numbering order).

--remote-click-position xxy

Sets the remote click's position.

--remote-click-type type

Sets the remote click's type. Possible values: single and double.

-s n, --slot-size n, slot_size n

Set grid slot size to n, which cannot be less then icon_size. By default, the slot size is the same as the icon size.

--scrollbars mode, scrollbars mode

Set scrollbar mode. Possible values: vertical, horizontal, all, or none (default). Scrollbars appear as additional space at tray borders that can be clicked to scroll icon area. Mouse wheel also works.

--scrollbars-highlight mode, scrollbars_highlight mode

Set scrollbars highlight mode. Possible values: a color spec, or disable.

--scrollbars-size n, scrollbars_size n

Set scrollbar size to n pixels. By default, the size is 1/4 of slot_size.

--scrollbars-step n, scrollbars_step n

Set scrollbar step to n pixels. Default is 1/2 of slot_size.

--skip-taskbar, skip_taskbar [bool]

Hide tray`s window from the taskbar. Default value: false.

--sticky, sticky [bool]

Make tray`s window sticky across multiple desktops/pages. Default value: false.

--tint-color, tint_color [bool]

Set tinting color. Default value: white.

--tint-level, tint_level [level]

Set tinting level. Default value: 0 (tinting disabled).

-t, --transparent, transparent [bool]

Enable root transparency. Default value: false.

-v, --vertical, vertical [bool]

Use vertical layout of icons (horizontal is used by default).

--window-layer layer, window_layer layer

Sets the EWMH-compliant layer of tray`s window. Possible values for layer: bottom, normal, top. Default value: normal.

--window-strut mode, window_strut mode

Enable window struts for tray window (to avoid covering of tray window by maximized windows). Mode defines to which screen border tray window will be attached. It can be either top, bottom, left, right, none, or auto (default).

--window-type type, window_type type

Sets the EWMH-compliant type of tray`s window. Possible values for type: desktop, dock, normal, toolbar, utility. Default value: dock.

--xsync, xsync [bool]

Operate on X server synchronously (SLOW, turned off by default).

DEPRECATIONS

As of stalonetray 0.8, the following command line and configuration file parameters are deprecated:

--dbg-level, dbg_level

Please use --log-level instead.

--max-tray-width, --max-tray-height, max_tray_width, max_tray_height

Please use --max-geometry instead.

-w, --withdrawn, withdrawn

Please use --dockapp-mode instead.

--respect-icon-hints, respect_icon_hints

Please use --kludges with use_icon_hints parameter instead.

FILES

$HOME/.stalonetrayrc — default configuration file.

BUGS

There are some, definetly.

If you have found a bug, please try to reproduce it with the log level set to trace and send the log file to me: . If you need support, the best way to get it is also to e-mail me directly. If you have installed stalonetray from a distribution repository, you can also file a bug in the respective bug tracking database.

stalonetray-0.8.3/stalonetray.xml0000644000175000017500000005074512475441262016250 0ustar varunvarun Roman Dubtsov stalonetray 1 stalonetray stalonetray 0.8 User Commands stalonetray stand-alone system tray (notification area) implementation. This document covers 0.8 version of stalonetray. stalonetray option DESCRIPTION Stalonetray is a stand-alone system tray (notification area) for X Window System/X11 (e.g. XOrg or XFree86). It has minimal build and run-time dependencies: an X11 lib only. Complete XEMBED support is under development. Stalonetray works with virtually any EWMH-compliant window manager. The behaviour and the look of stalonetray can be configured either via command line options or via configuration file. As usual, command-line options have precedence over options that are specified in the configuration file. Names of command line parameter may have two variants: short () and long (). Write value or value to pass a value using the short name of a parameter; to pass a value using a long name, write value or =value. All flag-like parameters have optional boolean value that when ommited is assumed to be "true". Write "true", "yes", "1", for positive boolean values, and "false", "no", "0" for negative ones. Default configuration file is $HOME/.stalonetrayrc. A configuration file contains case-insensetive keyword-argument pairs, one per line. Lines starting with '#' and empty lines are ignored. Alternatively, confiuration file can specified via or command-line options. Below is the list of possible command line/configuration file options. Options starting with hyphens are command-line parameters others are configuration file keywords. Options that are new in 0.8 version are marked with "NEW in 0.8". OPTIONS color color color Use color for tray`s background. color can be specified as an HTML hex triplet or as a name from rgb.txt (note that '#' must be quoted). Default value: #777777. filename filename Read configuration from filename instead of default $HOME/.stalonetrayrc. decspec decspec decspec Specify visiblie tray window decorations. Possible values for decspec are: all, title, border, none (default). display display Use X display display. mode mode Set dockapp mode, which can be either simple for e.g. OpenBox, wmaker for WindowMaker, or none (default). level level level Enable fuzzy edges of tray window and set fuzziness level which can range from 0 (disabled, default) to 3. When ommited, the value of level defaults to 2. geometry_spec geometry_spec Set tray`s initial geometry to geometry_spec, specified in standard X notation: widthxheight[+x[+y]], where width and height are specified in icon slot multiples. Default value: 1x1+0-0. gravity gravity Specify icon positioning gravity (eigher N, S, W, E, NW, NE, SW, SE). Grow gravity specifies directions in which the tray's window may grow. For instance, if you specify NW the tray's window will grow down vertically and to the right horizontally (these are sides that are opposite to upper-left or North-West corner of the window); with W the tray's window will grow horizontally to the left side only, and it will vertically grow both upwards and downwards maintaining position of its center. Please note that the latter behaviour is new in 0.8. Default value: NW. gravity gravity Specify icon positioning gravity (either NW, NE, SW, SE). If you specify, e.g SW, then icons will appear starting from the lower-left corner of the tray's window. Default value: NW. n n n Set default icon size to n. Default value: 24. Minimum: 16. Show help message. level level Set the amount of info to be output by stalonetray. Possible values for level: err (default), info, and trace. For the trace option to be available, stalonetray must be configured with at build-time. kludge,kludge Enable specific kludges to work around non-conforming WMs and/or stalonetray bugs. Argument is a comma-separated list of: fix_window_pos — fix tray window position on erroneous moves by WM force_icons_size — ignore resize events on all icons; force their size to be equal to use_icons_hints — use icon window hints to determine icon size geometry_spec geometry_spec Set tray`s maximal geometry to geometry_spec Default value: 0x0, no limit. bool Do not shrink tray window back after icon removal. Useful when tray is swallowed by another window like FvwmButtons. Default value: false. bool Use the parent's window as a background of the tray's window. Default value: false. path_to_xpm Use the pixmap from an XPM file specified by path_to_xpm for the tray`s window background (pixmap will be tiled to fill the entire window). name name Remote control/click. When this option is specified, stalonetray sends a fake click to the icon with a window named name and exits. The icon is searched for in the currently active tray for the current screen. By default, stalonetray sends a single click with the 1st mouse button to the center of the icon. See the options below for additional information on how to alter the defaults. n Sets the remote click's button number to n (in the X11 numbering order). xxy Sets the remote click's position. type Sets the remote click's type. Possible values: single and double. n n n Set grid slot size to n, which cannot be less then . By default, the slot size is the same as the icon size. mode mode Set scrollbar mode. Possible values: vertical, horizontal, all, or none (default). Scrollbars appear as additional space at tray borders that can be clicked to scroll icon area. Mouse wheel also works. mode mode Set scrollbars highlight mode. Possible values: a color spec, or disable. n n Set scrollbar size to n pixels. By default, the size is 1/4 of . n n Set scrollbar step to n pixels. Default is 1/2 of . bool Hide tray`s window from the taskbar. Default value: false. bool Make tray`s window sticky across multiple desktops/pages. Default value: false. bool Set tinting color. Default value: white. level Set tinting level. Default value: 0 (tinting disabled). bool Enable root transparency. Default value: false. bool Use vertical layout of icons (horizontal is used by default). layer layer Sets the EWMH-compliant layer of tray`s window. Possible values for layer: bottom, normal, top. Default value: normal. mode mode Enable window struts for tray window (to avoid covering of tray window by maximized windows). Mode defines to which screen border tray window will be attached. It can be either top, bottom, left, right, none, or auto (default). type type Sets the EWMH-compliant type of tray`s window. Possible values for type: desktop, dock, normal, toolbar, utility. Default value: dock. bool Operate on X server synchronously (SLOW, turned off by default). DEPRECATIONS As of stalonetray 0.8, the following command line and configuration file parameters are deprecated: Please use instead. Please use instead. Please use instead. Please use with use_icon_hints parameter instead. FILES $HOME/.stalonetrayrc — default configuration file. BUGS There are some, definetly. If you have found a bug, please try to reproduce it with the log level set to trace and send the log file to me: busa_ru@users.sourceforge.net. If you need support, the best way to get it is also to e-mail me directly. If you have installed stalonetray from a distribution repository, you can also file a bug in the respective bug tracking database. stalonetray-0.8.3/COPYING0000644000175000017500000004311010751351740014174 0ustar varunvarun GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. stalonetray-0.8.3/src/0000755000175000017500000000000012475445167013745 5ustar varunvarunstalonetray-0.8.3/src/debug.c0000644000175000017500000001074012461504712015164 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * debug.c * Mon, 01 May 2006 01:44:42 +0700 * ------------------------------- * Debugging code/utilities * -------------------------------*/ #include "config.h" #include "debug.h" #include "xutils.h" #include #include #include #include #ifdef DBG_PRINT_PID #include #include #endif int debug_output_disabled = 0; /* Disables all output from debugging macros */ void debug_disable_output() { debug_output_disabled = 1; } /* Print the message to STDERR (varadic macros is not used in the sake of portability) */ void print_message_to_stderr(const char *fmt,...) { static char msg[PATH_MAX]; va_list va; va_start(va, fmt); vsnprintf(msg, PATH_MAX, fmt, va); va_end(va); fprintf(stderr, "%s", msg); } #ifdef DEBUG int trace_mode = False; void print_trace_header(const char *funcname, const char *fname, const int line) { static pid_t pid = 0; #ifdef TRACE_TIMESTAMP { static char timestr[PATH_MAX+1]; time_t curtime = time(NULL); struct tm * loctime = localtime(&curtime); strftime(timestr, PATH_MAX, "%b %e %H:%M:%S", loctime); fprintf(stderr, "%s ", timestr); } #endif #ifdef TRACE_WM_NAME fprintf(stderr, "%s ", settings.wnd_name); #endif #ifdef TRACE_PID if (!pid) pid = getpid(); fprintf(stderr, "(%d) ", pid); #endif #ifdef TRACE_DPY if (tray_data.dpy != NULL) fprintf(stderr, "(%s) ", DisplayString(tray_data.dpy)); else fprintf(stderr, "(dpy) "); #endif #ifdef TRACE_VERBOSE_LOCATION fprintf(stderr, "(%s:%4d) ", fname, line); #endif fprintf(stderr, "%s(): ", funcname); } #endif /* Print the summary of icon data */ int print_icon_data(struct TrayIcon *ti) { #ifdef DEBUG XWindowAttributes xwa; #endif LOG_INFO (("wid = 0x%x\n", ti->wid)); LOG_TRACE((" self = %p\n", ti)); LOG_TRACE((" prev = %p\n", ti->prev)); LOG_TRACE((" next = %p\n", ti->next)); LOG_TRACE((" invalid = %d\n", ti->is_invalid)); LOG_TRACE((" layed_out = %d\n", ti->is_layed_out)); LOG_TRACE((" update_pos = %d\n", ti->is_updated)); LOG_INFO ((" name = %s\n", x11_get_window_name(tray_data.dpy, ti->wid, ""))); LOG_INFO ((" visible = %d\n", ti->is_visible)); LOG_INFO ((" position (grid) = %dx%d+%d+%d\n", ti->l.grd_rect.w, ti->l.grd_rect.h, ti->l.grd_rect.x, ti->l.grd_rect.y)); LOG_INFO ((" position (pixels) = %dx%d+%d+%d\n", ti->l.icn_rect.w, ti->l.icn_rect.h, ti->l.icn_rect.x, ti->l.icn_rect.y)); LOG_INFO ((" wnd_sz = %dx%d\n", ti->l.wnd_sz.x, ti->l.wnd_sz.y)); LOG_TRACE((" cmode = %d\n", ti->cmode)); LOG_INFO ((" xembed = %d\n", ti->is_xembed_supported)); if (ti->is_xembed_supported) { LOG_TRACE((" xembed_accepts_focus = %d\n", ti->is_xembed_accepts_focus)); LOG_TRACE((" xembed_last_timestamp = %d\n", ti->xembed_last_timestamp)); LOG_TRACE((" xembed_last_msgid = %d\n", ti->xembed_last_msgid)); } LOG_INFO((" embedded = %d\n", ti->is_embedded)); #ifdef DEBUG if (ti->is_embedded) { LOG_TRACE((" mid-parent = 0x%x\n", ti->mid_parent)); if (!XGetWindowAttributes(tray_data.dpy, ti->mid_parent, &xwa)) { LOG_TRACE((" ERR: XGetWindowAttributes() on mid-parent window faied\n")); } else { LOG_TRACE((" mid-parent wid = 0x%x\n", ti->mid_parent)); LOG_TRACE((" mid-parent state = %s\n", xwa.map_state == IsUnmapped ? "Unmapped" : (xwa.map_state == IsUnviewable ? "Unviewable" : "Viewable"))); LOG_TRACE((" mid-parent geometry = %dx%d+%d+%d\n", xwa.width, xwa.height, xwa.x, xwa.y)); } } if (settings.log_level > LOG_LEVEL_INFO) { Window real_parent, root, *children = NULL; unsigned int nchildren = 0; int rc; rc = XQueryTree(tray_data.dpy, ti->wid, &root, &real_parent, &children, &nchildren); if (rc && children != NULL && nchildren > 0) XFree(children); if (!rc) { LOG_TRACE((" ERR: XQueryTree() failed\n")); } else { LOG_TRACE((" parent wid from XQueryTree() = 0x%x\n", real_parent)); } } if (!XGetWindowAttributes(tray_data.dpy, ti->wid, &xwa)) { LOG_TRACE((" ERR: XGetWindowAttributes() on icon window failed\n")); } else { LOG_TRACE((" geometry from XGetWindowAttributes() = %dx%d+%d+%d\n", xwa.width, xwa.height, xwa.x, xwa.y)); LOG_TRACE((" mapstate from XGetWindowAttributes() = %s\n", xwa.map_state == IsUnmapped ? "Unmapped" : (xwa.map_state == IsUnviewable ? "Unviewable" : "Viewable"))); } #endif /* This resets x11 error state (which might have left from X11 calls above) */ x11_ok(); return NO_MATCH; } void dump_icon_list() { icon_list_forall(&print_icon_data); } stalonetray-0.8.3/src/xutils.h0000644000175000017500000000757012461504712015442 0ustar varunvarun/* ************************************ * vim:tabstop=4:shiftwidth=4 * xutils.h * Sun, 05 Mar 2006 17:16:44 +0600 * ************************************ * misc X11 utilities * ************************************/ #ifndef _XUTILS_H_ #define _XUTILS_H_ #include #include #include "common.h" #include "icons.h" /* Returns 1 if connection is active, 0 otherwise */ int x11_connection_status(); /* Return current server timestamp */ Time x11_get_server_timestamp(Display *dpy, Window wnd); /* Convinient way to send a client message event */ int x11_send_client_msg32(Display *dpy, Window dst, Window wnd, Atom type, long data0, long data1, long data2, long data3, long data4); /* Same for visibility event */ int x11_send_visibility(Display *dpy, Window dst, long state); /* Same for expose event */ int x11_send_expose(Display *dpy, Window dst, int x, int y, int width, int height); /* Same for button event */ int x11_send_button(Display *dpy, int press, Window dst, Window root, Time time, unsigned int button, unsigned int state, int x, int y); /* Refresh window */ int x11_refresh_window(Display *dpy, Window dst, int width, int height, int exposures); /* Set window size updating its size hints */ int x11_set_window_size(Display *dpy, Window w, int x, int y); /* Get window size (uses XGetWindowAttributes) */ int x11_get_window_size(Display *dpy, Window w, int *x, int *y); /* Get window minimal size hints if they are available */ int x11_get_window_min_size(Display *dpy, Window w, int *x, int *y); /* Retrive 32-bit property from the target window */ int x11_get_window_prop32(Display *dpy, Window dst, Atom atom, Atom type, unsigned char **data, unsigned long *len); /* Retrive window-list property from the specified window */ #define x11_get_winlist_prop(dpy, dst, atom, data, len) x11_get_window_prop32(dpy, dst, atom, XA_WINDOW, data, len) /* Shortcut for the root window case */ #define x11_get_root_winlist_prop(dpy, atom, data, len) x11_get_winlist_prop(dpy, DefaultRootWindow(dpy), atom, data, len) /* Returns window absolute position (relative to the root window) */ int x11_get_window_abs_coords(Display *dpy, Window dst, int *x, int *y); /* Get window name. NOT THREAD SAFE. Returns pointer to static buffer */ char *x11_get_window_name(Display *dpy, Window dst, char *def); /* Find subwindow by name */ Window x11_find_subwindow_by_name(Display *dpy, Window tgt, char *name); /* Find subwindow by at coords */ Window x11_find_subwindow_at(Display *dpy, Window top, int *x, int *y, int depth); /* Extends event mask of the root window */ void x11_extend_root_event_mask(Display *dpy, long mask); /* Parse text representation of a color */ int x11_parse_color(Display *dpy, char *str, XColor *color); /* Checks if any X11 errors have occured so far. */ /* ACHTUNG!!! after any sequence X operations any of which * that might have failed, you _must_ call x11_ok(), since * it resets the internal error flag. If you dont, it will show * up as a error elsewhere. JFYI, always check for x11_ok() first, * since * if (!rc || x11_ok()) { fail; } * is likely to leave error condition on: x11_ok() wont be called * if rc != 0. */ #define x11_ok() x11_ok_helper(__FILE__, __LINE__, __FUNC__) int x11_ok_helper(const char * file, const int line, const char *func); /* WARNING: following functions do not support nested calls */ /* Installs custom X11 error handler */ void x11_trap_errors(); /* Removes custom X11 error handler */ int x11_untrap_errors(); #ifdef DEBUG /* Array that maps event_number -> event_name */ const extern char *x11_event_names[LASTEvent]; /* Dumps window info. Does nothing unless ENABLE_DUMP_WIN_INFO is defined, * launches xwininfo and xwinprop otherwise */ void x11_dump_win_info(Display *dpy, Window w); #else /* Dummy delcaration */ #define x11_dump_win_info(dpy,w) do {} while (0); #endif #endif stalonetray-0.8.3/src/Makefile.am0000644000175000017500000000077312461504712015773 0ustar varunvarunbin_PROGRAMS = stalonetray stalonetray_SOURCES = main.c icons.c icons.h xembed.c xembed.h layout.c layout.h embed.c embed.h \ settings.c settings.h xutils.c xutils.h tray.c tray.h debug.h list.h \ wmh.c wmh.h common.h debug.c image.c image.h \ scrollbars.c scrollbars.h EXTRA_stalonetray_SOURCES = kde_tray.c kde_tray.h stalonetray_DEPENDENCIES = @kde_tray_support@ AM_CFLAGS = @X_CFLAGS@ stalonetray_LDADD = @kde_tray_support@ @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ stalonetray-0.8.3/src/xutils.c0000644000175000017500000002606612461504712015436 0ustar varunvarun/* ************************************ * vim:tabstop=4:shiftwidth=4 * xutils.c * Sun, 05 Mar 2006 17:56:56 +0600 * ************************************ * misc X11 utilities * ************************************/ #include "config.h" #include #include #include #include #include #include #include "xutils.h" #include "xembed.h" #include "debug.h" #include "common.h" static int trapped_x11_error_code = 0; static int (*old_x11_error_handler) (Display *, XErrorEvent *) = NULL; static int current_x11_connection_status = 1; static int (*old_x11_io_error_handler) (Display *) = NULL; int x11_io_error_handler(Display *dpy) { current_x11_connection_status = 0; old_x11_io_error_handler(dpy); DIE(("Connection to X11 server lost. Dying.\n")); } int x11_connection_status() { return current_x11_connection_status; } int x11_error_handler(Display *dpy, XErrorEvent *err) { static char msg[PATH_MAX], req_num_str[32], req_str[PATH_MAX]; trapped_x11_error_code = err->error_code; XGetErrorText(dpy, trapped_x11_error_code, msg, sizeof(msg)-1); snprintf(req_num_str, 32, "%d", err->request_code); XGetErrorDatabaseText(dpy, "XRequest", req_num_str, "Unknown", req_str, PATH_MAX); LOG_ERROR(("X11 error: %s (request: %s, resource 0x%x)\n", msg, req_str, err->request_code, err->minor_code, err->resourceid)); return 0; } int x11_ok_helper(const char *file, const int line, const char *func) { if (trapped_x11_error_code) { LOG_ERROR(("X11 error %d detected at %s:%d:%s\n", trapped_x11_error_code, file, line, func)); trapped_x11_error_code = 0; return FAILURE; } else return SUCCESS; } int x11_current_error() { return trapped_x11_error_code; } void x11_trap_errors() { old_x11_io_error_handler = XSetIOErrorHandler(x11_io_error_handler); old_x11_error_handler = XSetErrorHandler(x11_error_handler); trapped_x11_error_code = 0; } int x11_untrap_errors() { XSetErrorHandler(old_x11_error_handler); return trapped_x11_error_code; } static Window timestamp_wnd; static Atom timestamp_atom = None; Bool x11_wait_for_timestamp(Display *dpy, XEvent *xevent, XPointer data) { return ((xevent->type == PropertyNotify && xevent->xproperty.window == *((Window *)data) && xevent->xproperty.atom == timestamp_atom) || (xevent->type == DestroyNotify && xevent->xdestroywindow.window == *((Window *)data))); } Time x11_get_server_timestamp(Display *dpy, Window wnd) { unsigned char c = 's'; XEvent xevent; if (timestamp_atom == None) timestamp_atom = XInternAtom(dpy, "STALONETRAY_TIMESTAMP", False); x11_ok(); /* Just reset the status (XXX) */ /* Trigger PropertyNotify event which has a timestamp field */ XChangeProperty(dpy, wnd, timestamp_atom, timestamp_atom, 8, PropModeReplace, &c, 1); if (!x11_ok()) return CurrentTime; /* Wait for the event * XXX: this may block... */ timestamp_wnd = wnd; XIfEvent(dpy, &xevent, x11_wait_for_timestamp, (XPointer)×tamp_wnd); return x11_ok() ? xevent.xproperty.time : CurrentTime; } int x11_get_window_prop32(Display *dpy, Window dst, Atom atom, Atom type, unsigned char **data, unsigned long *len) { Atom act_type; int act_fmt, rc; unsigned long bytes_after, prop_len, buf_len; unsigned char *buf = NULL; *data = NULL; *len = 0; /* Get the property size */ rc = XGetWindowProperty(dpy, dst, atom, 0L, 1L, False, type, &act_type, &act_fmt, &buf_len, &bytes_after, &buf); /* The requested property does not exist */ if (!x11_ok() || rc != Success || act_type != type || act_fmt != 32) return FAILURE; if (buf != NULL) XFree(buf); /* Now go get the property */ prop_len = bytes_after / 4 + 1; XGetWindowProperty(dpy, dst, atom, 0L, prop_len, False, type, &act_type, &act_fmt, &buf_len, &bytes_after, &buf); if (x11_ok()) { *len = buf_len; *data = buf; return SUCCESS; } else { return FAILURE; } } int x11_send_client_msg32(Display *dpy, Window dst, Window wnd, Atom type, long data0, long data1, long data2, long data3, long data4) { XEvent ev; Status rc; ev.xclient.type = ClientMessage; ev.xclient.serial = 0; ev.xclient.send_event = True; ev.xclient.message_type = type; ev.xclient.window = wnd; ev.xclient.format = 32; ev.xclient.data.l[0] = data0; ev.xclient.data.l[1] = data1; ev.xclient.data.l[2] = data2; ev.xclient.data.l[3] = data3; ev.xclient.data.l[4] = data4; /* XXX: Replace 0xFFFFFF for better portability? */ /* XXX: This should actually read NoEventMask... * seems like extra parameter is necessary */ rc = XSendEvent(dpy, dst, False, 0xFFFFFF, &ev); return x11_ok() && rc != 0; } int x11_send_visibility(Display *dpy, Window dst, long state) { XEvent xe; int rc; xe.type = VisibilityNotify; xe.xvisibility.window = dst; xe.xvisibility.state = state; rc = XSendEvent(tray_data.dpy, dst, True, NoEventMask, &xe); return x11_ok() && rc != 0; } int x11_send_button(Display *dpy, int press, Window dst, Window root, Time time, unsigned int button, unsigned int state, int x, int y) { XEvent ev; int rx, ry, rc, idummy; unsigned int udummy; Window dst_root; if (!x11_get_window_abs_coords(dpy, dst, &rx, &ry)) return FAILURE; XGetGeometry(dpy, dst, &dst_root, &idummy, &idummy, &udummy, &udummy, &udummy, &udummy); if (!x11_ok()) return FAILURE; ev.type = press ? ButtonPress : ButtonRelease; ev.xbutton.display = dpy; ev.xbutton.window = dst; ev.xbutton.subwindow = None; ev.xbutton.root = root; ev.xbutton.time = time; ev.xbutton.x = x; ev.xbutton.y = y; ev.xbutton.x_root = rx + x; ev.xbutton.y_root = ry + y; ev.xbutton.button = button; ev.xbutton.state = state; ev.xbutton.same_screen = (root == dst_root); rc = XSendEvent(dpy, dst, True, SubstructureNotifyMask | (press ? ButtonPressMask : ButtonReleaseMask), &ev); return rc && x11_ok(); } int x11_send_expose(Display *dpy, Window dst, int x, int y, int width, int height) { XEvent xe; int rc; xe.type = Expose; xe.xexpose.window = dst; xe.xexpose.x = x; xe.xexpose.y = y; xe.xexpose.width = width; xe.xexpose.height = height; xe.xexpose.count = 0; rc = XSendEvent(tray_data.dpy, dst, True, NoEventMask, &xe); return x11_ok() && rc != 0; } int x11_refresh_window(Display *dpy, Window dst, int width, int height, int exposures) { x11_send_visibility(tray_data.dpy, dst, VisibilityFullyObscured); x11_send_visibility(tray_data.dpy, dst, VisibilityUnobscured); XClearArea(tray_data.dpy, dst, 0, 0, width, height, exposures); return x11_ok(); } int x11_set_window_size(Display *dpy, Window w, int x, int y) { XSizeHints xsh; xsh.flags = PSize; xsh.width = x; xsh.height = y; XSetWMNormalHints(dpy, w, &xsh); XResizeWindow(dpy, w, x, y); if (!x11_ok()) return FAILURE; return SUCCESS; } int x11_get_window_size(Display *dpy, Window w, int *x, int *y) { XWindowAttributes xwa; XGetWindowAttributes(dpy, w, &xwa); if (!x11_ok()) return FAILURE; *x = xwa.width; *y = xwa.height; return SUCCESS; } int x11_get_window_min_size(Display *dpy, Window w, int *x, int *y) { XSizeHints xsh; long flags = 0; int rc = FAILURE; if (XGetWMNormalHints(dpy, w, &xsh, &flags)) { flags = xsh.flags & flags; if (flags & PMinSize) { *x = xsh.min_width; *y = xsh.min_height; rc = SUCCESS; } } return x11_ok() && rc; } int x11_get_window_abs_coords(Display *dpy, Window dst, int *x, int *y) { XWindowAttributes xwa; Window child; #if 0 x11_ok(); /* XXX: this should go away, shouldn't it? */ #endif XGetWindowAttributes(dpy, dst, &xwa); XTranslateCoordinates(dpy, dst, xwa.root, 0, 0, x, y, &child); return x11_ok(); } char *x11_get_window_name(Display *dpy, Window dst, char *def) { static char *name; if (name != NULL) XFree(name); if (!XFetchName(dpy, dst, &name)) name = NULL; return (name != NULL ? name : def); } Window x11_find_subwindow_by_name(Display *dpy, Window tgt, char *name) { char *tgt_name = NULL; Window ret = None, *children, dummy; int i; unsigned int nchildren; if (XFetchName(dpy, tgt, &tgt_name)) { LOG_TRACE(("tgt_name=\"%s\", name=\"%s\"\n", tgt_name, name)); if (!strcmp(tgt_name, name)) ret = tgt; } if (!x11_ok()) return None; if (tgt_name != NULL) XFree(tgt_name); if (ret != None) return ret; XQueryTree(dpy, tgt, &dummy, &dummy, &children, &nchildren); if (!x11_ok()) return None; for (i = 0; i < nchildren; i++) { ret = x11_find_subwindow_by_name(dpy, children[i], name); if (ret != None) break; } if (children != NULL) XFree(children); return ret; } /* x and y are relative to top at input, and relative to found window on return */ Window x11_find_subwindow_at(Display *dpy, Window top, int *x, int *y, int depth) { int d, c, bx = 0, by = 0; Window dummy, *children; unsigned int nchildren; Window cur = top, old = None; for (d = 1; d != depth && cur != old && old != None; d++) { old = cur; /* Query children of current window and traverse them starting * from the top in stacking order (i.e. from the end of the list * returned by XQueryTree) */ XQueryTree(dpy, cur, &dummy, &dummy, &children, &nchildren); LOG_TRACE(("cur=0x%x nchildren=%d\n", cur, nchildren)); if (!x11_ok()) goto fail; /* Exit the loop if window has no children */ if (nchildren == 0) break; /* Loop over children starting from topmost */ for (c = nchildren-1; c >=0; c--) { XWindowAttributes xwa; XGetWindowAttributes(dpy, children[c], &xwa); if (!x11_ok()) goto fail; /* Check if this child contains the (x,y) point */ if (xwa.x + bx <= *x && *x < xwa.x + xwa.width + bx && xwa.y + by <= *y && *y < xwa.y + xwa.height + by) { cur = children[c]; bx += xwa.x; by += xwa.y; break; } } if (children != NULL) XFree(children); } *x -= bx; *y -= by; return cur; fail: if (children != NULL) XFree(children); return None; } void x11_extend_root_event_mask(Display *dpy, long mask) { static long old_mask = 0; old_mask |= mask; XSelectInput(dpy, DefaultRootWindow(dpy), old_mask); } int x11_parse_color(Display *dpy, char *str, XColor *color) { int rc; rc = XParseColor(dpy, XDefaultColormap(dpy, DefaultScreen(dpy)), str, color); if (rc) XAllocColor(dpy, XDefaultColormap(dpy, DefaultScreen(dpy)), color); return x11_ok() && rc; } #ifdef DEBUG const char *x11_event_names[LASTEvent] = { "unknown0", "unknown1", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify", "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear", "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify" }; void x11_dump_win_info(Display *dpy, Window wid) { #if defined(DEBUG) && defined(ENABLE_DUMP_WIN_INFO) if (settings.log_level >= LOG_LEVEL_TRACE) { char cmd[PATH_MAX]; snprintf(cmd, PATH_MAX, "xwininfo -tree -size -bits -stats -id 0x%x 1>&2\n", (unsigned int) wid); system(cmd); snprintf(cmd, PATH_MAX, "xprop -id 0x%x 1>&2\n", (unsigned int) wid); system(cmd); } #endif } #endif stalonetray-0.8.3/src/scrollbars.h0000644000175000017500000000406712461504712016256 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * tray.h * Mon, 09 Mar 2009 12:41:32 -0400 * ------------------------------- * Scrollbars data & interface * -------------------------------*/ #ifndef _SCROLLBAR_H_ #define _SCROLLBAR_H_ #include #include #include #define SB_WND_TOP 0 #define SB_WND_BOT 1 #define SB_WND_LFT 2 #define SB_WND_RHT 3 #define SB_WND_MAX 4 #define SB_MODE_NONE 0 #define SB_MODE_VERT 1 #define SB_MODE_HORZ 2 #define SCROLLBAR_REPEAT_COUNTDOWN_MAX_1ST 10 #define SCROLLBAR_REPEAT_COUNTDOWN_MAX_SUCC 5 /* Scrollbar data */ struct ScrollbarsData { struct Point scroll_base; /* Base scroll position */ struct Point scroll_pos; /* Current scroll position */ Window scrollbar[SB_WND_MAX]; /* Window IDs of scrollbars */ XSizeHints scrollbar_xsh[SB_WND_MAX]; /* Cached window sizes for scrollbars */ int scrollbar_down; /* Click state */ int scrollbar_highlighted; /* Highlight state */ int scrollbar_repeat_active; /* If repeat is active */ int scrollbar_repeat_counter; /* Countown for repeat action */ int scrollbar_repeats_done; /* Numberf of executed repeat actions */ }; /* Initialize data structures */ void scrollbars_init(); /* Create scrollbars windows */ void scrollbars_create(); /* Update positions of scrollbars */ int scrollbars_update(); /* Refresh scrollbars */ int scrollbars_refresh(int exposures); /* Get scrollbar under given coords */ int scrollbars_get_id(Window wid, int x, int y); /* Update tray wrt scrollbar click; * - id == SB_WND_MAX is a special case used to * update scroll positions without chaning it * (i.e. after icon removal) */ int scrollbars_click(int id); /* Event handler for scrollbars */ void scrollbars_handle_event(XEvent ev); /* Perform periodic tasks for scrollbars */ void scrollbars_periodic_tasks(); /* Scroll to icon */ int scrollbars_scroll_to(struct TrayIcon *ti); /* Highlight scrollbar */ int scrollbars_highlight_on(int id); /* Switch hightlight off */ int scrollbars_highlight_off(int id); #endif stalonetray-0.8.3/src/settings.c0000644000175000017500000010577512461504712015753 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * settings.c * Sun, 12 Sep 2004 18:55:53 +0700 * ------------------------------- * settings parser\container * -------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "common.h" #include "settings.h" #include "debug.h" #include "layout.h" #include "list.h" #include "tray.h" #include "xutils.h" #include "wmh.h" /* Here we keep our filthy settings */ struct Settings settings; /* Initialize data */ void init_default_settings() { settings.bg_color_str = "gray"; settings.tint_color_str = "white"; settings.scrollbars_highlight_color_str = "white"; settings.display_str = NULL; #ifdef DEBUG settings.log_level = LOG_LEVEL_ERR; #endif settings.geometry_str = NULL; settings.max_geometry_str = "0x0"; settings.icon_size = FALLBACK_ICON_SIZE; settings.slot_size = -1; settings.deco_flags = DECO_NONE; settings.max_tray_dims.x = 0; settings.max_tray_dims.y = 0; settings.parent_bg = 0; settings.shrink_back_mode = 1; settings.sticky = 1; settings.skip_taskbar = 1; settings.transparent = 0; settings.vertical = 0; settings.grow_gravity = GRAV_N | GRAV_W; settings.icon_gravity = GRAV_N | GRAV_W; settings.wnd_type = _NET_WM_WINDOW_TYPE_DOCK; settings.wnd_layer = NULL; settings.wnd_name = PROGNAME; settings.xsync = 0; settings.need_help = 0; settings.config_fname = NULL; settings.full_pmt_search = 1; settings.min_space_policy = 0; settings.pixmap_bg = 0; settings.bg_pmap_path = NULL; settings.tint_level = 0; settings.fuzzy_edges = 0; settings.dockapp_mode = DOCKAPP_NONE; settings.scrollbars_size = -1; settings.scrollbars_mode = SB_MODE_NONE; settings.scrollbars_inc = -1; settings.wm_strut_mode = WM_STRUT_AUTO; settings.kludge_flags = 0; settings.remote_click_name = NULL; settings.remote_click_btn = REMOTE_CLICK_BTN_DEFAULT; settings.remote_click_cnt = REMOTE_CLICK_CNT_DEFAULT; settings.remote_click_pos.x = REMOTE_CLICK_POS_DEFAULT; settings.remote_click_pos.y = REMOTE_CLICK_POS_DEFAULT; #ifdef DELAY_EMBEDDING_CONFIRMATION settings.confirmation_delay = 3; #endif } /* ******* general parsing utils ********* */ #define PARSING_ERROR(msg,str) if (!silent) LOG_ERROR(("Parsing error: " msg ", \"%s\" found\n", str)); /* Parse highlight color */ int parse_scrollbars_highlight_color(char *str, char ***tgt, int silent) { if (!strcasecmp(str, "disable")) **tgt = NULL; else { **tgt = strdup(str); if (**tgt == NULL) DIE_OOM(("Could not copy value from parameter\n")); } return SUCCESS; } /* Parse log level */ int parse_log_level(char *str, int **tgt, int silent) { if (!strcmp(str, "err")) **tgt = LOG_LEVEL_ERR; else if (!strcmp(str, "info")) **tgt = LOG_LEVEL_INFO; #ifdef DEBUG else if (!strcmp(str, "trace")) **tgt = LOG_LEVEL_TRACE; #endif else { PARSING_ERROR("err, info, or trace expected", str); return FAILURE; } return SUCCESS; } /* Parse dockapp mode */ int parse_dockapp_mode(char *str, int **tgt, int silent) { if (!strcmp(str, "none")) **tgt = DOCKAPP_NONE; else if (!strcmp(str, "simple")) **tgt = DOCKAPP_SIMPLE; else if (!strcmp(str, "wmaker")) **tgt = DOCKAPP_WMAKER; else { PARSING_ERROR("none, simple, or wmaker expected", str); return FAILURE; } return SUCCESS; } /* Parse gravity string ORing resulting value * with current value of tgt */ int parse_gravity(char *str, int **tgt, int silent) { int i, r = 0, s; if (str == NULL) goto fail; s = strlen(str); if (s > 2) goto fail; for (i = 0; i < s; i++) switch (tolower(str[i])) { case 'n': r |= GRAV_N; break; case 's': r |= GRAV_S; break; case 'w': r |= GRAV_W; break; case 'e': r |= GRAV_E; break; default: goto fail; } if ((r & GRAV_N && r & GRAV_S) || (r & GRAV_E && r & GRAV_W)) goto fail; **tgt = r; return SUCCESS; fail: PARSING_ERROR("gravity expected", str); return FAILURE; } /* Parse integer string storing resulting value in tgt */ int parse_int(char *str, int **tgt, int silent) { int r; char *tail; r = strtol(str, &tail, 0); if (*tail == 0) { **tgt = r; return SUCCESS; } else { PARSING_ERROR("integer expected", str); return FAILURE; } } /* Parse kludges mode */ int parse_kludges(char *str, int **tgt, int silent) { char *curtok = str, *rest = str; do { if ((rest = strchr(rest, ',')) != NULL) *(rest++) = 0; if (!strcasecmp(curtok, "fix_window_pos")) **tgt |= KLUDGE_FIX_WND_POS; /* else if (!strcasecmp(curtok, "fix_window_size"))*/ /* **tgt = KLUDGE_FIX_WND_SIZE;*/ else if (!strcasecmp(curtok, "force_icons_size")) **tgt |= KLUDGE_FORCE_ICONS_SIZE; else if (!strcasecmp(curtok, "use_icons_hints")) **tgt |= KLUDGE_USE_ICONS_HINTS; else { PARSING_ERROR("kludge flag expected", curtok); return FAILURE; } curtok = rest; } while (rest != NULL); return SUCCESS; } /* Parse strut mode */ int parse_strut_mode(char *str, int **tgt, int silent) { if (!strcasecmp(str, "auto")) **tgt = WM_STRUT_AUTO; else if (!strcasecmp(str, "top")) **tgt = WM_STRUT_TOP; else if (!strcasecmp(str, "bottom")) **tgt = WM_STRUT_BOT; else if (!strcasecmp(str, "left")) **tgt = WM_STRUT_LFT; else if (!strcasecmp(str, "right")) **tgt = WM_STRUT_RHT; else if (!strcasecmp(str, "none")) **tgt = WM_STRUT_NONE; else { PARSING_ERROR("one of top, bottom, left, right, or auto expected", str); return FAILURE; } return SUCCESS; } /* Parse boolean string storing result in tgt*/ int parse_bool(char *str, int **tgt, int silent) { if (!strcasecmp(str, "yes") || !strcasecmp(str, "on") || !strcasecmp(str, "true") || !strcasecmp(str, "1")) **tgt = True; else if (!strcasecmp(str, "no") || !strcasecmp(str, "off") || !strcasecmp(str, "false") || !strcasecmp(str, "0")) **tgt = False; else { PARSING_ERROR("boolean expected", str); return FAILURE; } return SUCCESS; } /* Backwards version of the boolean parser */ int parse_bool_rev(char *str, int **tgt, int silent) { if (parse_bool(str, tgt, silent)) { **tgt = !**tgt; return SUCCESS; } return FAILURE; } /* Parse window layer string storing result in tgt */ int parse_wnd_layer(char *str, char ***tgt, int silent) { if (!strcasecmp(str, "top")) **tgt = _NET_WM_STATE_ABOVE; else if (!strcasecmp(str, "bottom")) **tgt = _NET_WM_STATE_BELOW; else if (!strcasecmp(str, "normal")) **tgt = NULL; else { PARSING_ERROR("window layer expected", str); return FAILURE; } return SUCCESS; } /* Parse window type string storing result in tgt */ int parse_wnd_type(char *str, char ***tgt, int silent) { if (!strcasecmp(str, "dock")) **tgt = _NET_WM_WINDOW_TYPE_DOCK; else if (!strcasecmp(str, "toolbar")) **tgt = _NET_WM_WINDOW_TYPE_TOOLBAR; else if (!strcasecmp(str, "utility")) **tgt = _NET_WM_WINDOW_TYPE_UTILITY; else if (!strcasecmp(str, "normal")) **tgt = _NET_WM_WINDOW_TYPE_NORMAL; else if (!strcasecmp(str, "desktop")) **tgt = _NET_WM_WINDOW_TYPE_DESKTOP; else { PARSING_ERROR("window type expected", str); return FAILURE; } return SUCCESS; } /* Just copy string from arg to *tgt */ int parse_copystr(char *str, char ***tgt, int silent) { /* Valgrind note: this memory will never * be freed before stalonetray's exit. */ **tgt = strdup(str); if (**tgt == NULL) DIE_OOM(("Could not copy value from parameter\n")); return SUCCESS; } /* Parses window decoration specification */ int parse_deco(char *str, int **tgt, int silent) { if (!strcasecmp(str, "none")) **tgt = DECO_NONE; else if (!strcasecmp(str, "all")) **tgt = DECO_ALL; else if (!strcasecmp(str, "border")) **tgt = DECO_BORDER; else if (!strcasecmp(str, "title")) **tgt = DECO_TITLE; else { PARSING_ERROR("decoration specification expected", str); return FAILURE; } return SUCCESS; } /* Parses window decoration specification */ int parse_sb_mode(char *str, int **tgt, int silent) { if (!strcasecmp(str, "none")) **tgt = 0; else if (!strcasecmp(str, "vertical")) **tgt = SB_MODE_VERT; else if (!strcasecmp(str, "horizontal")) **tgt = SB_MODE_HORZ; else if (!strcasecmp(str, "all")) **tgt = SB_MODE_HORZ | SB_MODE_VERT; else { PARSING_ERROR("scrollbars specification expected", str); return FAILURE; } return SUCCESS; } #if 0 /* Parses remote op specification */ int parse_remote(char *str, void **tgt, int silent) { #define NEXT_TOK(str, rest) do { \ (str) = (rest); \ if ((str) != NULL) { \ (rest) = strchr((str), ','); \ if ((rest) != NULL) *((rest)++)=0; \ } \ } while(0) #define PARSE_INT(tgt, str, tail, def, msg) do { \ if (str == NULL || *(str) == '\0') { \ (tgt) = def; \ } else { \ (tgt) = strtol((str), &(tail), 0); \ if (*(tail) != '\0') { \ PARSING_ERROR(msg, (str)); \ return FAILURE; \ } \ } \ } while(0) /* Handy names for parameters */ int *flag = (int *) tgt[0]; char **name = (char **) tgt[1]; int *btn = (int *) tgt[2]; struct Point *pos = (struct Point *) tgt[3]; /* Local variables */ char *rest = str, *tail; if (str == NULL || strlen(str) == 0) return FAILURE; *flag = 1; NEXT_TOK(str, rest); *name = strdup(str); NEXT_TOK(str, rest); PARSE_INT(*btn, str, tail, INT_MIN, "remote click: button number expected"); NEXT_TOK(str, rest); PARSE_INT(pos->x, str, tail, INT_MIN, "remote click: x coordinate expected"); NEXT_TOK(str, rest); PARSE_INT(pos->y, str, tail, INT_MIN, "remote click: y coordinate expected"); return SUCCESS; #undef NEXT_TOK #undef PARSE_INT } #endif int parse_remote_click_type(char *str, int **tgt, int silent) { if (!strcasecmp(str, "single")) **tgt = 1; else if (!strcasecmp(str, "double")) **tgt = 2; else { PARSING_ERROR("click type can be single or double", str); return FAILURE; } return SUCCESS; } int parse_pos(char *str, void **tgt, int silent) { struct Point *pos = (struct Point *) tgt[0]; unsigned int dummy; XParseGeometry(str, &pos->x, &pos->y, &dummy, &dummy); return SUCCESS; } /************ CLI **************/ #define MAX_TARGETS 10 /* parameter parser function */ typedef int (*param_parser_t) (char *str, void *tgt[MAX_TARGETS], int silent); struct Param { char *short_name; /* Short command line parameter name */ char *long_name; /* Long command line parameter name */ char *rc_name; /* Parameter name for rc file */ void *target[MAX_TARGETS];/* Pointers to the values that are set by this parameter */ param_parser_t parser; /* Pointer to parsing function */ int pass; /* 0th pass parameters are parsed before rc file, 1st pass parameters are parsed after it */ int takes_arg; /* Wheather this parameter takes an argument */ int optional_arg; /* Wheather the argument is optional */ char *default_arg_val; /* Default value of the argument if none is given */ /* char *desc; */ /* TODO: Description */ }; struct Param params[] = { {"-display", NULL, "display", {&settings.display_str}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {NULL, "--log-level", "log_level", {&settings.log_level}, (param_parser_t) &parse_log_level, 1, 1, 0, NULL}, {"-bg", "--background", "background", {&settings.bg_color_str}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {"-c", "--config", NULL, {&settings.config_fname}, (param_parser_t) &parse_copystr, 0, 1, 0, NULL}, #ifdef DELAY_EMBEDDING_CONFIRMATION {NULL, "--confirmation-delay", "confirmation_delay", {&settings.confirmation_delay}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, #endif {"-d", "--decorations", "decorations", {&settings.deco_flags}, (param_parser_t) &parse_deco, 1, 1, 1, "all"}, {NULL, "--dockapp-mode", "dockapp_mode", {&settings.dockapp_mode}, (param_parser_t) &parse_dockapp_mode, 1, 1, 1, "simple"}, {"-f", "--fuzzy-edges", "fuzzy_edges", {&settings.fuzzy_edges}, (param_parser_t) &parse_int, 1, 1, 1, "2"}, {"-geometry", "--geometry", "geometry", {&settings.geometry_str}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {NULL, "--grow-gravity", "grow_gravity", {&settings.grow_gravity}, (param_parser_t) &parse_gravity, 1, 1, 0, NULL}, {NULL, "--icon-gravity", "icon_gravity", {&settings.icon_gravity}, (param_parser_t) &parse_gravity, 1, 1, 0, NULL}, { "-i", "--icon-size", "icon_size", {&settings.icon_size}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, {"-h", "--help", NULL, {&settings.need_help}, (param_parser_t) &parse_bool, 0, 0, 0, "true" }, {NULL, "--kludges", "kludges", {&settings.kludge_flags}, (param_parser_t) &parse_kludges, 1, 1, 0, NULL}, {NULL, "--max-geometry", "max_geometry", {&settings.max_geometry_str}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {NULL, "--no-shrink", "no_shrink", {&settings.shrink_back_mode}, (param_parser_t) &parse_bool_rev, 1, 1, 1, "true"}, {"-p", "--parent-bg", "parent_bg", {&settings.parent_bg}, (param_parser_t) &parse_bool, 1, 1, 1, "true"}, #ifdef XPM_SUPPORTED {NULL, "--pixmap-bg", "pixmap_bg", {&settings.bg_pmap_path}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, #endif {"-r", "--remote-click-icon", NULL, {&settings.remote_click_name}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {NULL, "--remote-click-button", NULL, {&settings.remote_click_btn}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, {NULL, "--remote-click-position", NULL, {&settings.remote_click_pos}, (param_parser_t) &parse_pos, 1, 1, 0, NULL}, {NULL, "--remote-click-type", NULL, {&settings.remote_click_cnt}, (param_parser_t) &parse_remote_click_type, 1, 1, 0, NULL}, {NULL, "--scrollbars", "scrollbars", {&settings.scrollbars_mode}, (param_parser_t) &parse_sb_mode, 1, 1, 0, NULL}, {NULL, "--scrollbars-highlight", "scrollbars_highlight", {&settings.scrollbars_highlight_color_str}, (param_parser_t) &parse_scrollbars_highlight_color, 1, 1, 0, NULL}, {NULL, "--scrollbars-step", "scrollbars_step", {&settings.scrollbars_inc}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, {NULL, "--scrollbars-size", "scrollbars_size", {&settings.scrollbars_size}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, {NULL, "--skip-taskbar", "skip_taskbar", {&settings.skip_taskbar}, (param_parser_t) &parse_bool, 1, 1, 1, "true"}, {"-s", "--slot-size", "slot_size", {&settings.slot_size}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, {NULL, "--sticky", "sticky", {&settings.sticky}, (param_parser_t) &parse_bool, 1, 1, 1, "true"}, {NULL, "--tint-color", "tint_color", {&settings.tint_color_str}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {NULL, "--tint-level", "tint_level", {&settings.tint_level}, (param_parser_t) &parse_int, 1, 1, 0, NULL}, {"-t", "--transparent", "transparent", {&settings.transparent}, (param_parser_t) &parse_bool, 1, 1, 1, "true"}, {"-v", "--vertical", "vertical", {&settings.vertical}, (param_parser_t) &parse_bool, 1, 1, 1, "true"}, {NULL, "--window-layer", "window_layer", {&settings.wnd_layer}, (param_parser_t) &parse_wnd_layer, 1, 1, 0, NULL}, {NULL, "--window-name", "window_name", {&settings.wnd_name}, (param_parser_t) &parse_copystr, 1, 1, 0, NULL}, {NULL, "--window-strut", "window_strut", {&settings.wm_strut_mode}, (param_parser_t) &parse_strut_mode, 1, 1, 0, NULL}, {NULL, "--window-type", "window_type", {&settings.wnd_type}, (param_parser_t) &parse_wnd_type, 1, 1, 0, NULL}, {NULL, "--xsync", "xsync", {&settings.xsync}, (param_parser_t) &parse_bool, 1, 1, 1, "true"}, {NULL, NULL, NULL, {NULL}} }; void usage(char *progname) { printf( "\nstalonetray "VERSION" [ " FEATURE_LIST " ]\n"); printf( "\nUsage: %s [options...]\n", progname); printf( "\n" "For short options argument can be specified as -o value or -ovalue.\n" "For long options argument can be specified as --option value or\n" "--option=value. All flag-options have expilicit optional boolean \n" "argument, which can be true (1, yes) or false (0, no).\n" "\n" "Possible options are:\n" " -display use X display \n" " -bg, --background select background color (default: #777777)\n" " -c, --config read configuration from \n" " (instead of default $HOME/.stalonetrayrc)\n" " -d, --decorations set what part of window decorations are\n" " visible; deco can be: none (default),\n" " title, border, all\n" " --dockapp-mode [] enable dockapp mode; mode can be none (default),\n" " simple (default if no mode specified), or wmaker\n" " -f, --fuzzy-edges [] set edges fuzziness level from\n" " 0 (disabled) to 3 (maximum); works with\n" " tinting and/or pixmap background;\n" " if not specified, level defaults to 2\n" " [-]-geometry set initial tray`s geometry (width and height\n" " are defined in icon slots; offsets are defined\n" " in pixels)\n" " --grow-gravity set tray`s grow gravity,\n" " either to N, S, W, E, NW, NE, SW, or SE\n" " --icon-gravity icon positioning gravity (NW, NE, SW, SE)\n" " -i, --icon-size set basic icon size to ; default is 24\n" " -h, --help show this message\n" #ifdef DEBUG " --log-level set the level of output to either err\n" " (default), info, or trace\n" #else " --log-level set the level of output to either err\n" " (default), or info\n" #endif " --kludges enable specific kludges to work around\n" " non-conforming WMs and/or stalonetray bugs;\n" " argument is a comma-separated list of:\n" " - fix_window_pos (fix window position),\n" " - force_icons_size (ignore icon resizes),\n" " - use_icons_hints (use icon size hints)\n" " --max-geometry set tray maximal width and height; 0 indicates\n" " no limit in respective direction\n" " --no-shrink do not shrink window back after icon removal\n" " -p, --parent-bg use parent for background\n" " --pixmap-bg use pixmap for tray`s window background\n" " -r, --remote-click-icon remote control (assumes an instance of\n" " stalonetray is already an active tray on this\n" " screen); sends click to icon which window's \n" " name is \n" " --remote-click-button defines mouse button for --remote-click-icon\n" " --remote-click-position x defines position for --remote-click-icon\n" " --remote-click-type defines click type for --remote-click-icon;\n" " type can be either single, or double\n" " --scrollbars set scrollbar mode either to all, horizontal,\n" " vertical, or none\n" " --scrollbars-highlight set scrollbar highlighting mode which can\n" " be either color spec (default color is red)\n" " or disable\n" " --scrollbars-step set scrollbar step to n pixels\n" " --scrollbars-size set scrollbar size to n pixels\n" " --slot-size set icon slot size to n\n" " --skip-taskbar hide tray`s window from the taskbar\n" " --sticky make tray`s window sticky across multiple\n" " desktops/pages\n" " -t, --transparent enable root transparency\n" " --tint-color tint tray background with color (not used\n" " with plain color background)\n" " --tint-level set tinting level from 0 to 255\n" " -v, --vertical use vertical layout of icons (horizontal\n" " layout is used by default)\n" " --window-layer set tray`s window EWMH layer\n" " either to bottom, normal, or top\n" " --window-strut set window strut mode to either auto,\n" " left, right, top, or bottom\n" " --window-type set tray`s window EWMH type to either\n" " normal, dock, toolbar, utility, desktop\n" " --xsync operate on X server synchronously (SLOW)\n" "\n" ); } /* Parse command line parameters */ int parse_cmdline(int argc, char **argv, int pass) { struct Param *p, *match; char *arg, *progname = argv[0]; while (--argc > 0) { argv++; match = NULL; for (p = params; p->parser != NULL; p++) { if (p->takes_arg) { if (p->short_name != NULL && strstr(*argv, p->short_name) == *argv) { if ((*argv)[strlen(p->short_name)] != '\0') /* accept arguments in the form -a5 */ arg = *argv + strlen(p->short_name); else if (argc > 1 && argv[1][0] != '-') { /* accept arguments in the form -a 5, do not accept values starting with '-' */ arg = *(++argv); argc--; } else if(!p->optional_arg) { /* argument is missing */ LOG_ERROR(("%s expects an argument\n", p->short_name)); break; } else /* argument is optional, use default value */ arg = p->default_arg_val; } else if (p->long_name != NULL && strstr(*argv, p->long_name) == *argv) { if ((*argv)[strlen(p->long_name)] == '=') /* accept arguments in the form --abcd=5 */ arg = *argv + strlen(p->long_name) + 1; else if ((*argv)[strlen(p->long_name)] == '\0') { /* accept arguments in the from ---abcd 5 */ if (argc > 1 && argv[1][0] != '-' ) { /* arguments cannot start with the dash */ arg = *(++argv); argc--; } else if (!p->optional_arg) { /*argument is missing */ LOG_ERROR(("%s expects an argument\n", p->long_name)); break; } else /* argument is optional, use default value */ arg = p->default_arg_val; } else continue; /* just in case when there can be both --abc and --abcd */ } else continue; match = p; break; } else if (strcmp(*argv, p->short_name) == 0 || strcmp(*argv, p->long_name) == 0) { match = p; arg = p->default_arg_val; break; } } #define USAGE_AND_DIE() do { usage(progname); DIE(("Could not parse command line\n")); } while (0) if (match == NULL) USAGE_AND_DIE(); if (match->pass != pass) continue; if (arg == NULL) DIE_IE(("Argument cannot be NULL!\n")); LOG_TRACE(("cmdline: pass %d, param \"%s\", arg \"%s\"\n", pass, match->long_name != NULL ? match->long_name : match->short_name, arg)); if (!match->parser(arg, match->target, match->optional_arg)) { if (match->optional_arg) { argc++; argv--; assert(arg != match->default_arg_val); match->parser(match->default_arg_val, match->target, False); } else USAGE_AND_DIE(); } } if (settings.need_help) { usage(progname); exit(0); } return SUCCESS; } /************ .stalonetrayrc ************/ /************************************************************************************** * ::= [] [( )* ] [] * ::= ""| * ::= # **************************************************************************************/ /* Does exactly what its name says */ #define SKIP_SPACES(p) { for (; *p != 0 && isspace((int) *p); p++); } /* Break the line in argc, argv pair */ int get_args(char *line, int *argc, char ***argv) { int q_flag = 0; char *arg_start, *q_pos; *argc = 0; *argv = NULL; /* 1. Strip leading spaces */ SKIP_SPACES(line); if (0 == *line) { /* meaningless line */ return SUCCESS; } arg_start = line; /* 2. Strip comments */ for (; 0 != *line; line++) { q_flag = ('"' == *line) ? !q_flag : q_flag; if ('#' == *line && !q_flag) { *line = 0; break; } } if (q_flag) { /* disbalance of quotes */ LOG_ERROR(("Disbalance of quotes\n")); return FAILURE; } if (arg_start == line) { /* meaningless line */ return SUCCESS; } line--; /* 3. Strip trailing spaces */ for (; line != arg_start && isspace((int) *line); line--); if (arg_start == line) { /* meaningless line */ return FAILURE; } *(line + 1) = 0; /* this _is_ really ok since isspace(0) != 0 */ line = arg_start; /* 4. Extract arguments */ do { (*argc)++; /* Add space to store one more argument */ if (NULL == (*argv = realloc(*argv, *argc * sizeof(char *)))) DIE_OOM(("Could not allocate memory to parse parameters\n")); if (*arg_start == '"') { /* 4.1. argument is quoted: find matching quote */ arg_start++; (*argv)[*argc - 1] = arg_start; if (NULL == (q_pos = strchr(arg_start, '"'))) { free(*argv); DIE_IE(("Quotes balance calculation failed\n")); return FAILURE; } arg_start = q_pos; } else { /* 4.2. whitespace-separated argument: find fist whitespace */ (*argv)[*argc - 1] = arg_start; for (; 0 != *arg_start && !isspace((int) *arg_start); arg_start++); } if (*arg_start != 0) { *arg_start = 0; arg_start++; SKIP_SPACES(arg_start); } } while(*arg_start != 0); return SUCCESS; } #define READ_BUF_SZ 512 /* Parses rc file (path is either taken from settings.config_fname * or ~/.stalonetrayrc is used) */ void parse_rc() { char *home_dir; static char config_fname[PATH_MAX]; FILE *cfg; char buf[READ_BUF_SZ + 1]; int lnum = 0; int argc; char **argv, *arg; struct Param *p, *match; /* 1. Setup file name */ if (settings.config_fname == NULL) { if ((home_dir = getenv("HOME")) == NULL) { LOG_ERROR(("You have no $HOME. I'm sorry for you.\n")); return; } snprintf(config_fname, PATH_MAX-1, "%s/%s", home_dir, STALONETRAY_RC); settings.config_fname = config_fname; } LOG_INFO(("using config file \"%s\"\n", settings.config_fname)); /* 2. Open file */ cfg = fopen(settings.config_fname, "r"); if (cfg == NULL) { LOG_ERROR(("could not open %s (%s)\n", settings.config_fname, strerror(errno))); return; } /* 3. Read the file line by line */ buf[READ_BUF_SZ] = 0; while (!feof(cfg)) { lnum++; if (fgets(buf, READ_BUF_SZ, cfg) == NULL) { if (ferror(cfg)) LOG_ERROR(("read error (%s)\n", strerror(errno))); break; } if (!get_args(buf, &argc, &argv)) { DIE(("Configuration file parse error at %s:%d: could not parse line\n", settings.config_fname, lnum)); } if (!argc) continue; /* This is empty/comment-only line */ match = NULL; for (p = params; p->parser != NULL; p++) { if (p->rc_name != NULL && strcmp(argv[0], p->rc_name) == 0) { if (argc - 1 > (p->takes_arg ? 1 : 0) || (!p->optional_arg && argc - 1 < 1)) DIE(("Configuration file parse error at %s:%d:" "invalid number of args for \"%s\" (%s required)\n", settings.config_fname, lnum, argv[0], p->optional_arg ? "0/1" : "1" )); match = p; arg = (!p->takes_arg || (p->optional_arg && argc == 1)) ? p->default_arg_val : argv[1]; break; } } if (!match) { DIE(("Configuration file parse error at %s:%d: unrecognized rc file keyword \"%s\".\n", settings.config_fname, lnum, argv[0])); } assert(arg != NULL); LOG_TRACE(("rc: param \"%s\", arg \"%s\"\n", match->rc_name, arg)); if (!match->parser(arg, match->target, False)) { DIE(("Configuration file parse error at %s:%d: could not parse argument for \"%s\".\n", settings.config_fname, lnum, argv[0])); } free(argv); } fclose(cfg); } /* Interpret all settings that need an open display or other settings */ void interpret_settings() { static int gravity_matrix[11] = { ForgetGravity, EastGravity, WestGravity, ForgetGravity, SouthGravity, SouthEastGravity, SouthWestGravity, ForgetGravity, NorthGravity, NorthEastGravity, NorthWestGravity }; int geom_flags; int rc; int dummy; XWindowAttributes root_wa; /* Sanitize icon size */ val_range(settings.icon_size, MIN_ICON_SIZE, INT_MAX); if (settings.slot_size < settings.icon_size) settings.slot_size = settings.icon_size; /* Sanitize scrollbar settings */ if (settings.scrollbars_mode != SB_MODE_NONE) { val_range(settings.scrollbars_inc, settings.slot_size / 2, INT_MAX); if (settings.scrollbars_size < 0) settings.scrollbars_size = settings.slot_size / 4; } /* Sanitize all gravity strings */ settings.icon_gravity |= ((settings.icon_gravity & GRAV_V) ? 0 : GRAV_N); settings.icon_gravity |= ((settings.icon_gravity & GRAV_H) ? 0 : GRAV_W); settings.win_gravity = gravity_matrix[settings.grow_gravity]; settings.bit_gravity = gravity_matrix[settings.icon_gravity]; /* Parse all background-related settings */ #ifdef XPM_SUPPORTED settings.pixmap_bg = (settings.bg_pmap_path != NULL); #endif if (settings.pixmap_bg) { settings.parent_bg = False; settings.transparent = False; } if (settings.transparent) settings.parent_bg = False; /* Parse color-related settings */ if (!x11_parse_color(tray_data.dpy, settings.bg_color_str, &settings.bg_color)) DIE(("Could not parse background color \"%s\"\n", settings.bg_color_str)); if (settings.scrollbars_highlight_color_str != NULL) { if (!x11_parse_color(tray_data.dpy, settings.scrollbars_highlight_color_str, &settings.scrollbars_highlight_color)) { DIE(("Could not parse scrollbars highlight color \"%s\"\n", settings.bg_color_str)); } } /* Sanitize tint level value */ val_range(settings.tint_level, 0, 255); if (settings.tint_level) { /* Parse tint color */ if (!x11_parse_color(tray_data.dpy, settings.tint_color_str, &settings.tint_color)) DIE(("Could not parse tint color \"%s\"\n", settings.tint_color_str)); } /* Sanitize edges fuzziness */ val_range(settings.fuzzy_edges, 0, 3); /* Get dimensions of root window */ if (!XGetWindowAttributes(tray_data.dpy, DefaultRootWindow(tray_data.dpy), &root_wa)) DIE(("Could not get root window dimensions.\n")); tray_data.root_wnd.x = 0; tray_data.root_wnd.y = 0; tray_data.root_wnd.width = root_wa.width; tray_data.root_wnd.height = root_wa.height; /* Parse geometry */ # define DEFAULT_GEOMETRY "1x1+0+0" tray_data.xsh.flags = PResizeInc | PBaseSize; tray_data.xsh.x = 0; tray_data.xsh.y = 0; tray_data.xsh.width_inc = settings.slot_size; tray_data.xsh.height_inc = settings.slot_size; tray_data.xsh.base_width = 0; tray_data.xsh.base_height = 0; tray_calc_window_size(0, 0, &tray_data.xsh.base_width, &tray_data.xsh.base_height); geom_flags = XWMGeometry(tray_data.dpy, DefaultScreen(tray_data.dpy), settings.geometry_str, DEFAULT_GEOMETRY, 0, &tray_data.xsh, &tray_data.xsh.x, &tray_data.xsh.y, &tray_data.xsh.width, &tray_data.xsh.height, &tray_data.xsh.win_gravity); tray_data.xsh.win_gravity = settings.win_gravity; tray_data.xsh.min_width = tray_data.xsh.width; tray_data.xsh.min_height = tray_data.xsh.height; tray_data.xsh.max_width = tray_data.xsh.width; tray_data.xsh.min_height = tray_data.xsh.height; tray_data.xsh.flags = PResizeInc | PBaseSize | PMinSize | PMaxSize | PWinGravity; tray_calc_tray_area_size(tray_data.xsh.width, tray_data.xsh.height, &settings.orig_tray_dims.x, &settings.orig_tray_dims.y); /* Dockapp mode */ if (settings.dockapp_mode == DOCKAPP_WMAKER) tray_data.xsh.flags |= USPosition; else { if (geom_flags & (XValue | YValue)) tray_data.xsh.flags |= USPosition; else tray_data.xsh.flags |= PPosition; if (geom_flags & (WidthValue | HeightValue)) tray_data.xsh.flags |= USSize; else tray_data.xsh.flags |= PSize; } LOG_TRACE(("final geometry: %dx%d at (%d,%d)\n", tray_data.xsh.width, tray_data.xsh.height, tray_data.xsh.x, tray_data.xsh.y)); if ((geom_flags & XNegative) && (geom_flags & YNegative)) settings.geom_gravity = SouthEastGravity; else if (geom_flags & YNegative) settings.geom_gravity = SouthWestGravity; else if (geom_flags & XNegative) settings.geom_gravity = NorthEastGravity; else settings.geom_gravity = NorthWestGravity; /* Set tray maximal width/height */ geom_flags = XParseGeometry(settings.max_geometry_str, &dummy, &dummy, (unsigned int *) &settings.max_tray_dims.x, (unsigned int *) &settings.max_tray_dims.y); LOG_TRACE(("max geometry from max_geometry_str: %dx%d\n", settings.max_tray_dims.x, settings.max_tray_dims.y)); if (!settings.max_tray_dims.x) settings.max_tray_dims.x = root_wa.width; else { settings.max_tray_dims.x *= settings.slot_size; val_range(settings.max_tray_dims.x, settings.orig_tray_dims.x, INT_MAX); } if (!settings.max_tray_dims.y) settings.max_tray_dims.y = root_wa.height; else { settings.max_tray_dims.y *= settings.slot_size; val_range(settings.max_tray_dims.y, settings.orig_tray_dims.y, INT_MAX); } LOG_TRACE(("max geometry after normalization: %dx%d\n", settings.max_tray_dims.x, settings.max_tray_dims.y)); /* XXX: this assumes certain degree of symmetry and in some point * in the future this may not be the case... */ tray_calc_window_size(0, 0, &tray_data.scrollbars_data.scroll_base.x, &tray_data.scrollbars_data.scroll_base.y); tray_data.scrollbars_data.scroll_base.x /= 2; tray_data.scrollbars_data.scroll_base.y /= 2; } /************** "main" ***********/ int read_settings(int argc, char **argv) { init_default_settings(); /* Parse 0th pass command line args */ parse_cmdline(argc, argv, 0); /* Parse configuration files */ parse_rc(); /* Parse 1st pass command line args */ parse_cmdline(argc, argv, 1); /* Display some settings */ LOG_TRACE(("stalonetray "VERSION" [ " FEATURE_LIST " ]\n")); LOG_TRACE(("bg_color_str = \"%s\"\n", settings.bg_color_str)); LOG_TRACE(("config_fname = \"%s\"\n", settings.config_fname)); LOG_TRACE(("deco_flags = 0x%x\n", settings.deco_flags)); LOG_TRACE(("display_str = \"%s\"\n", settings.display_str)); LOG_TRACE(("dockapp_mode = %d\n", settings.dockapp_mode)); LOG_TRACE(("full_pmt_search = %d\n", settings.full_pmt_search)); LOG_TRACE(("geometry_str = \"%s\"\n", settings.geometry_str)); LOG_TRACE(("grow_gravity = 0x%x\n", settings.grow_gravity)); LOG_TRACE(("icon_gravity = 0x%x\n", settings.icon_gravity)); LOG_TRACE(("icon_size = %d\n", settings.icon_size)); LOG_TRACE(("log_level = %d\n", settings.log_level)); LOG_TRACE(("max_tray_dims.x = %d\n", settings.max_tray_dims.x)); LOG_TRACE(("max_tray_dims.y = %d\n", settings.max_tray_dims.y)); LOG_TRACE(("min_space_policy = %d\n", settings.min_space_policy)); LOG_TRACE(("need_help = %d\n", settings.need_help)); LOG_TRACE(("parent_bg = %d\n", settings.parent_bg)); LOG_TRACE(("scrollbars_highlight_color_str = \"%s\"\n", settings.scrollbars_highlight_color_str)); LOG_TRACE(("scrollbars_highlight_color.pixel = %ld\n", settings.scrollbars_highlight_color.pixel)); LOG_TRACE(("scrollbars_inc = %d\n", settings.scrollbars_inc)); LOG_TRACE(("scrollbars_mode = %d\n", settings.scrollbars_mode)); LOG_TRACE(("scrollbars_size = %d\n", settings.scrollbars_size)); LOG_TRACE(("shrink_back_mode = %d\n", settings.shrink_back_mode)); LOG_TRACE(("slot_size = %d\n", settings.slot_size)); LOG_TRACE(("vertical = %d\n", settings.vertical)); LOG_TRACE(("xsync = %d\n", settings.xsync)); return SUCCESS; } stalonetray-0.8.3/src/tray.c0000644000175000017500000006226412461504712015065 0ustar varunvarun/* ************************************ * vim:tabstop=4:shiftwidth=4:cindent:fen:fdm=syntax * tray.c * Tue, 07 Mar 2006 10:36:10 +0600 * ************************************ * tray functions * ************************************/ #include "config.h" #include #include #include #include #ifdef XPM_SUPPORTED #include #endif #include #include "common.h" #include "tray.h" #include "settings.h" #include "xutils.h" #include "wmh.h" #include "embed.h" #include "image.h" #include "icons.h" #ifndef NO_NATIVE_KDE #include "kde_tray.h" #endif #include "debug.h" void tray_init() { tray_data.tray = None; tray_data.hint_win = None; tray_data.dpy = NULL; tray_data.terminated = False; tray_data.bg_pmap = None; tray_data.xa_xrootpmap_id = None; tray_data.xa_xsetroot_id = None; tray_data.kde_tray_old_mode = 0; scrollbars_init(); } #ifdef XPM_SUPPORTED int tray_init_pixmap_bg() { XpmAttributes xpma; Pixmap mask = None; int rc; xpma.valuemask = 0; rc = XpmReadFileToPixmap( tray_data.dpy, tray_data.tray, settings.bg_pmap_path, &tray_data.bg_pmap, &mask, &xpma); if (rc != XpmSuccess) { DIE(("Could not read background pixmap from %s.\n", settings.bg_pmap_path)); return FAILURE; } /* Ignore the mask */ if (mask != None) XFreePixmap(tray_data.dpy, mask); tray_data.bg_pmap_dims.x = xpma.height; tray_data.bg_pmap_dims.y = xpma.width; LOG_TRACE(("created background pixmap (%dx%d)\n", xpma.width, xpma.height)); return SUCCESS; } #endif /* Mostly from FVWM:fvwm/colorset.c:172 */ Pixmap tray_get_root_pixmap(Atom prop) { Atom type; int format; unsigned long length, after; unsigned char *reteval = NULL; int ret; Pixmap pix = None; Window root_window = XRootWindow(tray_data.dpy, DefaultScreen(tray_data.dpy)); ret = XGetWindowProperty(tray_data.dpy, root_window, prop, 0L, 1L, False, XA_PIXMAP, &type, &format, &length, &after, &reteval); if (x11_ok() && ret == Success && type == XA_PIXMAP && format == 32 && length == 1 && after == 0) pix = (Pixmap)(*(long *)reteval); if (reteval) XFree(reteval); return pix; } /* Originally from FVWM:fvwm/colorset.c:195 */ int tray_update_root_bg_pmap(Pixmap *pmap, int *width, int *height) { unsigned int w = 0, h = 0; int rc = 0; XID dummy; Pixmap pix = None; /* Retrive root image pixmap */ /* Try _XROOTPMAP_ID first */ if (tray_data.xa_xrootpmap_id != None) pix = tray_get_root_pixmap(tray_data.xa_xrootpmap_id); /* Else try _XSETROOT_ID */ if (!pix && tray_data.xa_xsetroot_id != None) pix = tray_get_root_pixmap(tray_data.xa_xsetroot_id); /* Get root pixmap size */ if (pix) rc = XGetGeometry(tray_data.dpy, pix, &dummy, (int *)&dummy, (int *)&dummy, &w, &h, (unsigned int *)&dummy, (unsigned int *)&dummy); if (!x11_ok() || !pix || !rc) { LOG_TRACE(("could not update root background pixmap\n")); return FAILURE; } *pmap = pix; if (width != NULL) *width = w; if (height != NULL) *height = h; LOG_TRACE(("got new root pixmap: 0x%lx (%ix%i)\n", pix, w, h)); return SUCCESS; } /* XXX: most of Pixmaps are not really needed. Use XImages instead. * GCs, XImages and Pixmaps stay allocated during cleanup, valgrind * complains. Who cares? * TODO: move pixmaps/GCs into tray_data and free them during the exit. */ int tray_update_bg(int update_pixmap) { static Pixmap root_pmap = None; static Pixmap bg_pmap = None; static Pixmap final_pmap = None; static GC root_gc = None; static GC bg_gc = None; static GC final_gc = None; static int old_width = -1, old_height = -1; struct Rect clr; /* clipping rectangle */ struct Rect clr_loc; /* clipping rectangle in local coords */ XImage *bg_img; int bg_pmap_updated = False; #define make_gc(pmap,gc) do { XGCValues gcv; \ if (gc != None) XFreeGC(tray_data.dpy, gc); \ gcv.graphics_exposures = False; \ gc = XCreateGC(tray_data.dpy, pmap, GCGraphicsExposures, &gcv); \ } while(0) #define make_pmap(pmap) do { \ if (pmap != None) XFreePixmap(tray_data.dpy, pmap); \ pmap = XCreatePixmap(tray_data.dpy, tray_data.tray, \ tray_data.xsh.width, tray_data.xsh.height, \ DefaultDepth(tray_data.dpy, DefaultScreen(tray_data.dpy))); \ } while(0) #define recreate_pixmap(pmap,gc) do { \ make_pmap(pmap); \ make_gc(pmap, gc); \ } while(0) /* No need to update background if it is a color one */ if (!settings.transparent && !settings.pixmap_bg) return SUCCESS; /* Calculate clipping rect */ clr.x = cutoff(tray_data.xsh.x, 0, tray_data.root_wnd.width); clr.y = cutoff(tray_data.xsh.y, 0, tray_data.root_wnd.height); clr.w = cutoff(tray_data.xsh.x + tray_data.xsh.width, 0, tray_data.root_wnd.width) - clr.x; clr.h = cutoff(tray_data.xsh.y + tray_data.xsh.height, 0, tray_data.root_wnd.height) - clr.y; /* There's no need to update background if tray is not visible */ /* TODO: visibility is better to be tracked using some events */ if (clr.w == 0 || clr.h == 0) return SUCCESS; /* Calculate local clipping rect */ clr_loc.x = clr.x - tray_data.xsh.x; clr_loc.y = clr.y - tray_data.xsh.y; clr_loc.w = clr.w; clr_loc.h = clr.h; if (old_width != tray_data.xsh.width || old_height != tray_data.xsh.height || final_pmap == None) recreate_pixmap(final_pmap, final_gc); /* Update root pixmap if asked and necessary */ if ((root_pmap == None || update_pixmap) && (settings.transparent || settings.fuzzy_edges)) { if (!tray_update_root_bg_pmap(&root_pmap, NULL, NULL)) { /* More gracefull solution */ LOG_TRACE(("still waiting for root pixmap\n")); return SUCCESS; } else make_gc(root_pmap, root_gc); } /* We don't have to update background if only window position has * changed unless we depend on root pixmap */ if (tray_data.xsh.width == old_width && tray_data.xsh.width == old_height && !settings.transparent && !settings.fuzzy_edges) { return SUCCESS; } /* If pixmap bg is used, bg_pmap holds tinted and tiled background pixmap, * so there's no need to update it unless window size has changed */ if (settings.pixmap_bg && (bg_pmap == None || old_width != tray_data.xsh.width || old_height != tray_data.xsh.height)) { int i, j; recreate_pixmap(bg_pmap, bg_gc); for (i = 0; i < tray_data.xsh.width / tray_data.bg_pmap_dims.x + 1; i++) for (j = 0; j < tray_data.xsh.height / tray_data.bg_pmap_dims.y + 1; j++) { XCopyArea(tray_data.dpy, tray_data.bg_pmap, bg_pmap, bg_gc, 0, 0, tray_data.bg_pmap_dims.x, tray_data.bg_pmap_dims.y, i * tray_data.bg_pmap_dims.x, j * tray_data.bg_pmap_dims.y); } bg_pmap_updated = True; } else /* If root transparency is enabled, it is neccessary to copy portion of * root pixmap under the window (root_pmap) to bg_pmap */ /* XXX: must correctly work around situations when bg pixmap is smaller than root window (but how?) */ if (settings.transparent) { recreate_pixmap(bg_pmap, bg_gc); XCopyArea(tray_data.dpy, root_pmap, bg_pmap, bg_gc, tray_data.xsh.x, tray_data.xsh.y, tray_data.xsh.width, tray_data.xsh.height, 0, 0); } /* Create an XImage from bg_pmap */ bg_img = XGetImage(tray_data.dpy, bg_pmap, 0, 0, tray_data.xsh.width, tray_data.xsh.height, XAllPlanes(), ZPixmap); if (bg_img == NULL) return FAILURE; /* Tint the image if necessary. If bg_pmap was not updated, tinting * is not needed, since it has been already done */ if (settings.tint_level && ((settings.pixmap_bg && bg_pmap_updated) || settings.transparent)) { image_tint(bg_img, &settings.tint_color, settings.tint_level); XPutImage(tray_data.dpy, bg_pmap, bg_gc, bg_img, 0, 0, 0, 0, tray_data.xsh.width, tray_data.xsh.height); bg_pmap_updated = False; } /* Apply fuzzy edges */ /* XXX: THIS IS UGLY */ if (settings.fuzzy_edges) { static CARD8 *alpha_mask = NULL; /* Portion of root pixmap under the tray */ XImage *root_img = XGetImage(tray_data.dpy, root_pmap, clr.x, clr.y, clr.w, clr.h, XAllPlanes(), ZPixmap); /* Proxy structure to work on */ XImage *tmp_img = NULL; static Pixmap tmp_pmap = None; static GC tmp_gc = None; if (root_img == NULL) { LOG_ERROR(("Failed to get image of root pixmap under tray window\n")); LOG_TRACE(("Clipping rectangle: %dx%d+%d+%d\n", clr.w, clr.h, clr.x, clr.y)); return x11_ok(); } /* Alpha mask needs to be updated only on size changes */ if (old_width != tray_data.xsh.width || old_height != tray_data.xsh.height) { recreate_pixmap(tmp_pmap, tmp_gc); if (alpha_mask != NULL) free(alpha_mask); alpha_mask = image_create_alpha_mask(settings.fuzzy_edges, tray_data.xsh.width, tray_data.xsh.height); } XPutImage(tray_data.dpy, tmp_pmap, tmp_gc, root_img, clr_loc.x, clr_loc.y, 0, 0, clr_loc.w, clr_loc.h); tmp_img = XGetImage(tray_data.dpy, tmp_pmap, 0, 0, tray_data.xsh.width, tray_data.xsh.height, XAllPlanes(), ZPixmap); if (alpha_mask != NULL && tmp_img != NULL) image_compose(bg_img, tmp_img, alpha_mask); XDestroyImage(root_img); if (tmp_img != NULL) XDestroyImage(tmp_img); } XPutImage(tray_data.dpy, final_pmap, final_gc, bg_img, 0, 0, 0, 0, tray_data.xsh.width, tray_data.xsh.height); XSetWindowBackgroundPixmap(tray_data.dpy, tray_data.tray, final_pmap); XDestroyImage(bg_img); old_width = tray_data.xsh.width; old_height = tray_data.xsh.height; RETURN_STATUS(x11_ok()); } void tray_refresh_window(int exposures) { LOG_TRACE(("refreshing tray window\n")); icon_list_forall(&embedder_refresh); x11_refresh_window(tray_data.dpy, tray_data.tray, tray_data.xsh.width, tray_data.xsh.height, exposures); scrollbars_refresh(exposures); } int tray_calc_window_size(int base_width, int base_height, int *wnd_width, int *wnd_height) { *wnd_width = base_width; *wnd_height = base_height; if (settings.scrollbars_mode & SB_MODE_HORZ) *wnd_width += settings.scrollbars_size * 2; if (settings.scrollbars_mode & SB_MODE_VERT) *wnd_height += settings.scrollbars_size * 2; return SUCCESS; } int tray_calc_tray_area_size(int wnd_width, int wnd_height, int *base_width, int *base_height) { *base_width = wnd_width; *base_height = wnd_height; if (settings.scrollbars_mode & SB_MODE_HORZ) *base_width -= settings.scrollbars_size * 2; if (settings.scrollbars_mode & SB_MODE_VERT) *base_height -= settings.scrollbars_size * 2; return SUCCESS; } int tray_update_window_strut() { /* Set window strut */ if (settings.wm_strut_mode != WM_STRUT_NONE) { int strut_mode; if (settings.wm_strut_mode == WM_STRUT_AUTO) { /* Do autodetection: if some edge of tray is adjacent to one * of screen edges, we could set window strut to that */ int h_strut_mode, v_strut_mode; int p_strut_mode, s_strut_mode; h_strut_mode = (tray_data.xsh.x == 0 ? WM_STRUT_LFT : (tray_data.xsh.x + tray_data.xsh.width == tray_data.root_wnd.width ? WM_STRUT_RHT : WM_STRUT_NONE)); v_strut_mode = (tray_data.xsh.y == 0 ? WM_STRUT_TOP : (tray_data.xsh.x + tray_data.xsh.height == tray_data.root_wnd.height ? WM_STRUT_BOT : WM_STRUT_NONE)); /* If tray is vertical, horizontal strut mode has higher priority, * else vertical strut mode has higher priority */ if (settings.vertical) { p_strut_mode = h_strut_mode; s_strut_mode = v_strut_mode; } else { p_strut_mode = v_strut_mode; s_strut_mode = h_strut_mode; } if (p_strut_mode != WM_STRUT_NONE) strut_mode = p_strut_mode; else strut_mode = s_strut_mode; } else strut_mode = settings.wm_strut_mode; LOG_TRACE(("computed final strut mode: %d\n", strut_mode)); /* Update respective window hint */ if (strut_mode != WM_STRUT_NONE) { wm_strut_t wm_strut; int base_idx; memset(wm_strut, 0, sizeof(wm_strut)); LOG_TRACE(("current tray geometry: %dx%d+%d+%d\n", tray_data.xsh.width, tray_data.xsh.height, tray_data.xsh.x, tray_data.xsh.y)); if (strut_mode == WM_STRUT_TOP || strut_mode == WM_STRUT_BOT) { if (strut_mode == WM_STRUT_TOP) { base_idx = WM_STRUT_IDX_TOP; wm_strut[WM_STRUT_IDX_TOP] = tray_data.xsh.y + tray_data.xsh.height; } else { base_idx = WM_STRUT_IDX_BOT; wm_strut[WM_STRUT_IDX_BOT] = tray_data.root_wnd.height - tray_data.xsh.y; } wm_strut[WM_STRUT_IDX_START(base_idx)] = tray_data.xsh.x; wm_strut[WM_STRUT_IDX_END(base_idx)] = tray_data.xsh.x + tray_data.xsh.width - 1; } else { if (strut_mode == WM_STRUT_LFT) { base_idx = WM_STRUT_IDX_LFT; wm_strut[WM_STRUT_IDX_LFT] = tray_data.xsh.x + tray_data.xsh.width; } else { base_idx = WM_STRUT_IDX_RHT; wm_strut[WM_STRUT_IDX_RHT] = tray_data.root_wnd.width - tray_data.xsh.x; } wm_strut[WM_STRUT_IDX_START(base_idx)] = tray_data.xsh.y; wm_strut[WM_STRUT_IDX_END(base_idx)] = tray_data.xsh.y + tray_data.xsh.height - 1; } { int i; for (i = 0; i < _NET_WM_STRUT_PARTIAL_SZ; i++) LOG_TRACE(("computed hints [%d] = %d\n", i, wm_strut[i])); } ewmh_set_window_strut(tray_data.dpy, tray_data.tray, wm_strut); } } return SUCCESS; } int tray_update_window_props() { XSizeHints xsh; int cur_base_width, cur_base_height; int new_width, new_height; int layout_width, layout_height; /* Phase 1: calculate new tray window dimensions. * Algorithm summary: * new_dims = * if (layout_dims > max_dims) max_dims; * else if ((shrink_back && layout_dims > orig_dims) || * (layout_dims > current_dims)) layout_dims; * else if (shrink_back) orig_dims; * else current_dims; */ x11_get_window_size(tray_data.dpy, tray_data.tray, &tray_data.xsh.width, &tray_data.xsh.height); layout_get_size(&layout_width, &layout_height); LOG_TRACE(("layout geometry: %dx%d\n", layout_width, layout_height)); tray_calc_tray_area_size(tray_data.xsh.width, tray_data.xsh.height, &cur_base_width, &cur_base_height); LOG_TRACE(("base tray geometry: %dx%d\n", cur_base_width, cur_base_height)); LOG_TRACE(("orig tray geometry: %dx%d\n", settings.orig_tray_dims.x, settings.orig_tray_dims.y)); LOG_TRACE(("max tray geometry: %dx%d\n", settings.max_tray_dims.x, settings.max_tray_dims.y)); #define CALC_DIM(tgt,cur,layout,max,orig) \ if (layout > max) tgt = max; \ else if ((settings.shrink_back_mode && layout > orig) || layout > cur) tgt = layout; \ else if (settings.shrink_back_mode) tgt = orig; \ else tgt = cur; CALC_DIM(new_width, cur_base_width, layout_width, settings.max_tray_dims.x, settings.orig_tray_dims.x); CALC_DIM(new_height, cur_base_height, layout_height, settings.max_tray_dims.y, settings.orig_tray_dims.y); LOG_TRACE(("new base tray geometry: %dx%d\n", new_width, new_height)); tray_calc_window_size(new_width, new_height, &new_width, &new_height); LOG_TRACE(("new tray geometry: %dx%d\n", new_width, new_height)); #if 1 /* Not sure if this is really necessary */ xsh.x = tray_data.xsh.x; xsh.y = tray_data.xsh.y; xsh.width = new_width; xsh.height = new_height; #endif xsh.min_width = new_width; xsh.min_height = new_height; xsh.max_width = new_width; xsh.max_height = new_height; xsh.width_inc = settings.slot_size; xsh.height_inc = settings.slot_size; tray_calc_window_size(0, 0, &xsh.base_width, &xsh.base_height); xsh.win_gravity = NorthWestGravity; xsh.flags = tray_data.xsh.flags; XSetWMNormalHints(tray_data.dpy, tray_data.tray, &xsh); /* Phase 2: set new window size * This check helps to avod extra (erroneous) moves of the window when * geometry changes are not updated yet, but tray_update_window_props() was * called once again */ if (new_width != tray_data.xsh.width || new_height != tray_data.xsh.height) { /* Apparently, not every WM (hello, WindowMaker!) handles gravity the * way I have expected (i.e. using it to calculate reference point as * described in ICCM/WM specs). Perhaps, I was dreaming. So, prior to * resizing trays window, it is necessary to recalculate window * absolute position and shift it according to grow gravity settings */ x11_get_window_abs_coords(tray_data.dpy, tray_data.tray, &tray_data.xsh.x, &tray_data.xsh.y); LOG_TRACE(("old tray window geometry: %dx%d+%d+%d\n", new_width, new_height, tray_data.xsh.x, tray_data.xsh.y)); if (settings.grow_gravity & GRAV_E) tray_data.xsh.x -= new_width - tray_data.xsh.width; else if (!(settings.grow_gravity & GRAV_H)) tray_data.xsh.x -= (new_width - tray_data.xsh.width) / 2; if (settings.grow_gravity & GRAV_S) tray_data.xsh.y -= new_height - tray_data.xsh.height; else if (!(settings.grow_gravity & GRAV_V)) tray_data.xsh.y -= (new_height - tray_data.xsh.height) / 2; tray_data.xsh.width = new_width; tray_data.xsh.height = new_height; LOG_TRACE(("new tray window geometry: %dx%d+%d+%d\n", new_width, new_height, tray_data.xsh.x, tray_data.xsh.y)); XResizeWindow(tray_data.dpy, tray_data.tray, new_width, new_height); XMoveWindow(tray_data.dpy, tray_data.tray, tray_data.xsh.x, tray_data.xsh.y); if (!x11_ok()) { LOG_TRACE(("could not update tray window geometry\n")); return FAILURE; } } else { /* XXX: Why do we need this again? */ XResizeWindow(tray_data.dpy, tray_data.tray, tray_data.xsh.width, tray_data.xsh.height); } tray_update_window_strut(); scrollbars_update(); return SUCCESS; } void tray_create_window(int argc, char **argv) { XTextProperty wm_name; XSetWindowAttributes xswa; XClassHint xch; XWMHints xwmh; Atom net_system_tray_orientation; Atom orient; Atom protocols_atoms[3]; /* Create some atoms */ tray_data.xa_wm_delete_window = XInternAtom(tray_data.dpy, "WM_DELETE_WINDOW", False); tray_data.xa_net_wm_ping = XInternAtom(tray_data.dpy, "_NET_WM_PING", False); tray_data.xa_wm_take_focus = XInternAtom(tray_data.dpy, "WM_TAKE_FOCUS", False); tray_data.xa_wm_protocols = XInternAtom(tray_data.dpy, "WM_PROTOCOLS", False); tray_data.xa_kde_net_system_tray_windows = XInternAtom(tray_data.dpy, "_KDE_NET_SYSTEM_TRAY_WINDOWS", False); tray_data.xa_net_client_list = XInternAtom(tray_data.dpy, "_NET_CLIENT_LIST", False); /* Create tray window */ tray_data.tray = XCreateSimpleWindow( tray_data.dpy, DefaultRootWindow(tray_data.dpy), tray_data.xsh.x, tray_data.xsh.y, tray_data.xsh.width, tray_data.xsh.height, 0, settings.bg_color.pixel, settings.bg_color.pixel); LOG_TRACE(("created tray window: 0x%x\n", tray_data.tray)); if (settings.dockapp_mode == DOCKAPP_WMAKER) { tray_data.hint_win = XCreateSimpleWindow( tray_data.dpy, DefaultRootWindow(tray_data.dpy), 0, 0, 1, 1, 0, settings.bg_color.pixel, settings.bg_color.pixel); LOG_TRACE(("created hint_win window: 0x%x\n", tray_data.hint_win)); } /* Set tray window properties */ xswa.bit_gravity = settings.bit_gravity; xswa.win_gravity = settings.win_gravity; xswa.backing_store = settings.parent_bg ? NotUseful : WhenMapped; XChangeWindowAttributes(tray_data.dpy, tray_data.tray, CWBitGravity | CWWinGravity | CWBackingStore, &xswa); { /* XXX: use XStoreName ?*/ int numtries = 0; /* First, try user-supplied value */ while (1) { if (XmbTextListToTextProperty(tray_data.dpy, &settings.wnd_name, 1, XTextStyle, &wm_name) != Success) /* Retry with default value */ settings.wnd_name = PROGNAME; else break; if (numtries++ > 1) DIE(("Invalid window name \"%s\"\n", settings.wnd_name)); } } XSetWMName(tray_data.dpy, tray_data.tray, &wm_name); XFree(wm_name.value); /* Setup class hints */ xch.res_class = PROGNAME; xch.res_name = PROGNAME; /* Setup window manager hints */ xwmh.flags = StateHint | InputHint; xwmh.input = False; xwmh.initial_state = settings.dockapp_mode != DOCKAPP_NONE ? WithdrawnState: NormalState; /* Apply hints */ XSetWMHints(tray_data.dpy, tray_data.tray, &xwmh); XSetClassHint(tray_data.dpy, tray_data.tray, &xch); XSetWMNormalHints(tray_data.dpy, tray_data.tray, &tray_data.xsh); XSetCommand(tray_data.dpy, tray_data.tray, argv, argc); /* Set properties of hint window if WindowMaker dockapp mode enabled */ if (settings.dockapp_mode == DOCKAPP_WMAKER) { xwmh.flags |= IconWindowHint | IconPositionHint | WindowGroupHint; xwmh.initial_state = WithdrawnState; xwmh.icon_x = tray_data.xsh.x; xwmh.icon_y = tray_data.xsh.y; xwmh.icon_window = tray_data.tray; xwmh.window_group = tray_data.hint_win; XSetClassHint(tray_data.dpy, tray_data.hint_win, &xch); XSetWMHints(tray_data.dpy, tray_data.hint_win, &xwmh); } /* v0.2 tray protocol support */ orient = settings.vertical ? _NET_SYSTEM_TRAY_ORIENTATION_HORZ : _NET_SYSTEM_TRAY_ORIENTATION_VERT; net_system_tray_orientation = XInternAtom(tray_data.dpy, TRAY_ORIENTATION_ATOM, False); XChangeProperty(tray_data.dpy, tray_data.tray, net_system_tray_orientation, net_system_tray_orientation, 32, PropModeReplace, (unsigned char *) &orient, 1); /* Ask X server / WM to report certain events */ protocols_atoms[0] = tray_data.xa_wm_delete_window; protocols_atoms[1] = tray_data.xa_wm_take_focus; protocols_atoms[2] = tray_data.xa_net_wm_ping; XSetWMProtocols(tray_data.dpy, tray_data.tray, protocols_atoms, 3); XSelectInput(tray_data.dpy, tray_data.tray, StructureNotifyMask | FocusChangeMask | PropertyChangeMask | ExposureMask ); x11_extend_root_event_mask(tray_data.dpy, PropertyChangeMask); scrollbars_create(); /* Set tray window background if necessary */ #ifdef XPM_SUPPORTED if (settings.pixmap_bg) tray_init_pixmap_bg(); #endif if (settings.parent_bg) XSetWindowBackgroundPixmap(tray_data.dpy, tray_data.tray, ParentRelative); else if (settings.transparent || settings.fuzzy_edges) { tray_data.xa_xrootpmap_id = XInternAtom(tray_data.dpy, "_XROOTPMAP_ID", False); tray_data.xa_xsetroot_id = XInternAtom(tray_data.dpy, "_XSETROOT_ID", False); } tray_update_bg(True); } void tray_create_phony_window() { /* Create fake tray window */ tray_data.tray = XCreateSimpleWindow( tray_data.dpy, DefaultRootWindow(tray_data.dpy), 0, 0, 1, 1, 0, 0, 0); /* Select for PropertyNotify so that x11_get_server_timestamp() works */ XSelectInput(tray_data.dpy, tray_data.tray, PropertyChangeMask); } int tray_set_wm_hints() { int mwm_decor = 0; if (settings.deco_flags & DECO_TITLE) mwm_decor |= MWM_DECOR_TITLE | MWM_DECOR_MENU; if (settings.deco_flags & DECO_BORDER) mwm_decor |= MWM_DECOR_RESIZEH | MWM_DECOR_BORDER; mwm_set_hints(tray_data.dpy, tray_data.tray, mwm_decor, MWM_FUNC_ALL); if (settings.sticky) { ewmh_add_window_state(tray_data.dpy, tray_data.tray, _NET_WM_STATE_STICKY); ewmh_set_window_atom32(tray_data.dpy, tray_data.tray, _NET_WM_DESKTOP, 0xFFFFFFFF); } if (settings.skip_taskbar) ewmh_add_window_state(tray_data.dpy, tray_data.tray, _NET_WM_STATE_SKIP_TASKBAR); if (settings.wnd_layer != NULL) ewmh_add_window_state(tray_data.dpy, tray_data.tray, settings.wnd_layer); if (strcmp(settings.wnd_type, _NET_WM_WINDOW_TYPE_NORMAL) != 0) ewmh_add_window_type(tray_data.dpy, tray_data.tray, settings.wnd_type); /* Alwas add NORMAL window type for WM that do not support (some) special types */ ewmh_add_window_type(tray_data.dpy, tray_data.tray, _NET_WM_WINDOW_TYPE_NORMAL); return SUCCESS; } void tray_init_selection_atoms() { static char *tray_sel_atom_name = NULL; /* Obtain selection atom name basing on current screen number */ if (tray_sel_atom_name == NULL) { tray_sel_atom_name = (char *)malloc(strlen(TRAY_SEL_ATOM) + 10); if (tray_sel_atom_name == NULL) DIE_OOM(("could not allocate memory for selection atom name\n")); snprintf(tray_sel_atom_name, strlen(TRAY_SEL_ATOM) + 10, "%s%u", TRAY_SEL_ATOM, DefaultScreen(tray_data.dpy)); } LOG_TRACE(("tray_sel_atom_name=%s\n", tray_sel_atom_name)); /* Initialize atom values */ tray_data.xa_tray_selection = XInternAtom(tray_data.dpy, tray_sel_atom_name, False); tray_data.xa_tray_opcode = XInternAtom(tray_data.dpy, "_NET_SYSTEM_TRAY_OPCODE", False); tray_data.xa_tray_data = XInternAtom(tray_data.dpy, "_NET_SYSTEM_TRAY_MESSAGE_DATA", False); } void tray_acquire_selection() { Time timestamp = x11_get_server_timestamp(tray_data.dpy, tray_data.tray); tray_init_selection_atoms(); /* Save old selection owner */ tray_data.old_selection_owner = XGetSelectionOwner(tray_data.dpy, tray_data.xa_tray_selection); LOG_TRACE(("old selection owner: 0x%x\n", tray_data.old_selection_owner)); /* Acquire selection */ XSetSelectionOwner(tray_data.dpy, tray_data.xa_tray_selection, tray_data.tray, timestamp); /* Check if we have really got the selection */ if (XGetSelectionOwner(tray_data.dpy, tray_data.xa_tray_selection) != tray_data.tray) { DIE(("could not set selection owner.\nMay be another (greedy) tray running?\n")); } else { tray_data.is_active = True; LOG_TRACE(("ok, got _NET_SYSTEM_TRAY selection\n")); } /* Send the message notifying about new MANAGER */ x11_send_client_msg32(tray_data.dpy, DefaultRootWindow(tray_data.dpy), DefaultRootWindow(tray_data.dpy), XInternAtom(tray_data.dpy, "MANAGER", False), timestamp, tray_data.xa_tray_selection, tray_data.tray, 0, 0); } void tray_show_window() { tray_set_wm_hints(); tray_update_window_props(); XMapRaised(tray_data.dpy, tray_data.tray); if (settings.dockapp_mode == DOCKAPP_NONE) XMoveWindow(tray_data.dpy, tray_data.tray, tray_data.xsh.x, tray_data.xsh.y); if (settings.dockapp_mode == DOCKAPP_WMAKER) XMapWindow(tray_data.dpy, tray_data.hint_win); /* XXX: I do not why, but for some WM it is * required to set hints / window properties * after and before window creation */ /* TODO: check if this is really necessary */ tray_set_wm_hints(); tray_update_window_props(); } stalonetray-0.8.3/src/config.h.in0000644000175000017500000000663312475441270015767 0ustar varunvarun/* src/config.h.in. Generated from configure.ac by autoheader. */ /* enable debugging code */ #undef DEBUG /* delay sending of embedding confirmation */ #undef DELAY_EMBEDDING_CONFIRMATION /* use xprop/xwininfo to dump icon window info */ #undef ENABLE_DUMP_WIN_INFO /* use non-portable hack to exit gracefuly on signal */ #undef ENABLE_GRACEFUL_EXIT_HACK /* System has usable backtrace implementation. */ #undef HAVE_BACKTRACE /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the `Xpm' library (-lXpm). */ #undef HAVE_LIBXPM /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* System has usable printstack implementation. */ #undef HAVE_PRINTSTACK /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* disable native kde tray icons support */ #undef NO_NATIVE_KDE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* enable full event trace (debug) */ #undef TRACE_EVENTS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* enable XPM background support */ #undef XPM_SUPPORTED /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE stalonetray-0.8.3/src/icons.c0000644000175000017500000001167612461504712015222 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * icons.c * Tue, 24 Aug 2004 12:05:38 +0700 * ------------------------------- * Manipulations with reparented * windows --- tray icons * -------------------------------*/ #include #include #include "icons.h" #include "common.h" #include "debug.h" #include "layout.h" #include "list.h" #include "tray.h" #ifdef DEBUG #include "xutils.h" #endif #include "assert.h" struct TrayIcon *icons_head = NULL; struct TrayIcon *icon_list_new(Window wid, int cmode) { struct TrayIcon *new_icon; /* Do not allocate second structure for the same window */ if (icon_list_find(wid) != NULL) return NULL; if ((new_icon = malloc(sizeof(struct TrayIcon))) == NULL) { LOG_ERR_OOM(("Could not allocate memory for new icon\n")); return NULL; } new_icon->wid = wid; new_icon->l.wnd_sz.x = 0; new_icon->l.wnd_sz.y = 0; new_icon->mid_parent = None; new_icon->cmode = cmode; new_icon->is_embedded = False; new_icon->is_layed_out = False; new_icon->is_updated = False; new_icon->is_resized = True; new_icon->is_visible = False; new_icon->is_invalid = False; new_icon->is_xembed_supported = False; new_icon->is_size_set = False; new_icon->num_size_resets = 0; LIST_ADD_ITEM(icons_head, new_icon); return new_icon; } int icon_list_free(struct TrayIcon *ti) { if (ti != NULL) { LIST_DEL_ITEM(icons_head, ti); free(ti); } return SUCCESS; } struct TrayIcon *icon_list_next(struct TrayIcon *ti) { return (ti != NULL && ti->next != NULL) ? ti->next : icons_head; } struct TrayIcon *icon_list_prev(struct TrayIcon *ti) { struct TrayIcon *tmp; if (ti != NULL && ti->prev != NULL) return ti->prev; else { tmp = icons_head; for (; tmp->next != NULL; tmp = tmp->next); return tmp; } } static struct TrayIcon *backup_head = NULL; int icon_list_backup() { struct TrayIcon *tmp, *cur, *cur2; /* Refuse to perform second backup in a row */ if (backup_head != NULL) { DIE_IE(("Only one backup of icon list at a time is supported\n")); } /* For each icon in the list we allocate new temporary structure and add it * to the end of temporary list backup_head */ for (cur = icons_head, cur2 = NULL; cur != NULL; cur = cur->next, cur2 = tmp) { tmp = (struct TrayIcon *) malloc(sizeof(struct TrayIcon)); if (tmp == NULL) { LOG_ERR_OOM(("Could not allocate backup list")); icon_list_backup_purge(); return FAILURE; } memcpy(tmp, cur, sizeof(struct TrayIcon)); LIST_INSERT_AFTER(backup_head, cur2, tmp); cur2 = tmp; } return SUCCESS; } int icon_list_restore() { struct TrayIcon *cur_b, *cur_i, *prev_sv, *next_sv; LOG_TRACE(("restoring the icon list from the backup\n")); /* Restore the list by copying raw data from * backup list. This assumes that sequences have the * same length. */ for (cur_i = icons_head, cur_b = backup_head; cur_i != NULL && cur_b != NULL; cur_i = cur_i->next, cur_b = cur_b->next) { prev_sv = cur_i->prev; next_sv = cur_i->next; memcpy(cur_i, cur_b, sizeof(struct TrayIcon)); cur_i->prev = prev_sv; cur_i->next = next_sv; } /* Some consistency checking: ensures that * both lists had the same length */ assert(cur_i == NULL && cur_b == NULL); /* Clean backup list */ LIST_CLEAN(backup_head, cur_b); backup_head = NULL; return SUCCESS; } int icon_list_backup_purge() { struct TrayIcon *tmp; LOG_TRACE(("purging the backed up icon list\n")); /* Clean backup list */ LIST_CLEAN(backup_head, tmp); backup_head = NULL; return SUCCESS; } struct TrayIcon *icon_list_find(Window wid) { /* Traverse the whole list */ struct TrayIcon *tmp; for (tmp = icons_head; tmp != NULL; tmp = tmp->next) if (tmp->wid == wid) return tmp; return NULL; } struct TrayIcon *icon_list_find_ex(Window wid) { /* Traverse the whole list */ struct TrayIcon *tmp; for (tmp = icons_head; tmp != NULL; tmp = tmp->next) if (tmp->wid == wid || tmp->mid_parent == wid) return tmp; return NULL; } int icon_list_clean() { struct TrayIcon *tmp; LIST_CLEAN(icons_head, tmp); return SUCCESS; } int icon_list_clean_callback(IconCallbackFunc cbk) { struct TrayIcon *tmp; LIST_CLEAN_CBK(icons_head, tmp, cbk); return SUCCESS; } /* TODO: is it necessary always to sort the full list? */ void icon_list_sort(IconCmpFunc cmp) { struct TrayIcon *new_head = NULL, *cur, *tmp; while (icons_head != NULL) { /* Find the least element and move it to temporary list */ cur = icons_head; for (tmp = icons_head; tmp != NULL; tmp = tmp->next) if (cmp(tmp, cur) > 0) cur = tmp; LIST_DEL_ITEM(icons_head, cur); LIST_ADD_ITEM(new_head, cur); } icons_head = new_head; } struct TrayIcon *icon_list_forall(IconCallbackFunc cbk) { return icon_list_forall_from(icons_head, cbk); } struct TrayIcon *icon_list_forall_from(struct TrayIcon *tgt, IconCallbackFunc cbk) { /* Traverse the list starting from tgt*/ struct TrayIcon *tmp; for (tmp = (tgt != NULL ? tgt : icons_head); tmp != NULL; tmp = tmp->next) if (cbk(tmp) == MATCH) { return tmp; } return NULL; } stalonetray-0.8.3/src/scrollbars.c0000644000175000017500000002622312461504712016247 0ustar varunvarun/* ************************************ * vim:tabstop=4:shiftwidth=4:cindent:fen:fdm=syntax * tray.c * Mon, 09 Mar 2009 12:38:30 -0400 * ************************************ * scrollbars functions * ************************************/ #include #include #include #include #include #include "xutils.h" #include "tray.h" #include "embed.h" void scrollbars_init() { tray_data.scrollbars_data.scroll_pos.x = 0; tray_data.scrollbars_data.scroll_pos.y = 0; tray_data.scrollbars_data.scroll_base.x = 0; tray_data.scrollbars_data.scroll_base.y = 0; tray_data.scrollbars_data.scrollbar_down = -1; } void scrollbars_create() { int i; /*#define DEBUG_SCROLLBAR_POSITIONS*/ if (settings.scrollbars_mode & SB_MODE_VERT) { tray_data.scrollbars_data.scrollbar[SB_WND_TOP] = XCreateSimpleWindow( tray_data.dpy, tray_data.tray, 0, 0, 1, 1, 0, #ifdef DEBUG_SCROLLBAR_POSITIONS 0xff00ff, 0xff00ff); #else settings.bg_color.pixel, settings.bg_color.pixel); #endif tray_data.scrollbars_data.scrollbar[SB_WND_BOT] = XCreateSimpleWindow( tray_data.dpy, tray_data.tray, 0, 0, 1, 1, 0, #ifdef DEBUG_SCROLLBAR_POSITIONS 0xffff00, 0xffff00); #else settings.bg_color.pixel, settings.bg_color.pixel); #endif } else { tray_data.scrollbars_data.scrollbar[SB_WND_TOP] = None; tray_data.scrollbars_data.scrollbar[SB_WND_BOT] = None; } if (settings.scrollbars_mode & SB_MODE_HORZ) { tray_data.scrollbars_data.scrollbar[SB_WND_LFT] = XCreateSimpleWindow( tray_data.dpy, tray_data.tray, 0, 0, 1, 1, 0, #ifdef DEBUG_SCROLLBAR_POSITIONS 0x00ff00, 0x00ff00); #else settings.bg_color.pixel, settings.bg_color.pixel); #endif tray_data.scrollbars_data.scrollbar[SB_WND_RHT] = XCreateSimpleWindow( tray_data.dpy, tray_data.tray, 0, 0, 1, 1, 0, #ifdef DEBUG_SCROLLBAR_POSITIONS 0x00ffff, 0x00ffff); #else settings.bg_color.pixel, settings.bg_color.pixel); #endif } else { tray_data.scrollbars_data.scrollbar[SB_WND_LFT] = None; tray_data.scrollbars_data.scrollbar[SB_WND_RHT] = None; } scrollbars_update(); for (i = 0; i < SB_WND_MAX; i++) if (tray_data.scrollbars_data.scrollbar[i] != None) { #ifndef DEBUG_SCROLLBAR_POSITIONS XSetWindowBackgroundPixmap(tray_data.dpy, tray_data.scrollbars_data.scrollbar[i], ParentRelative); #endif XMapRaised(tray_data.dpy, tray_data.scrollbars_data.scrollbar[i]); XSelectInput(tray_data.dpy, tray_data.scrollbars_data.scrollbar[i], ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask ); } } int scrollbars_refresh(int exposures) { int i; for (i = 0; i < SB_WND_MAX; i++) if (tray_data.scrollbars_data.scrollbar[i] != None) x11_refresh_window(tray_data.dpy, tray_data.scrollbars_data.scrollbar[i], tray_data.scrollbars_data.scrollbar_xsh[i].width, tray_data.scrollbars_data.scrollbar_xsh[i].height, exposures); return SUCCESS; } int scrollbars_update() { int offset, i; static int initialized = 0; XSizeHints scrollbar_xsh_local[SB_WND_MAX]; if (settings.scrollbars_mode & SB_MODE_HORZ) { offset = (settings.vertical && (settings.scrollbars_mode & SB_MODE_VERT)) ? settings.scrollbars_size : 0; scrollbar_xsh_local[SB_WND_LFT].x = 0; scrollbar_xsh_local[SB_WND_LFT].y = offset; scrollbar_xsh_local[SB_WND_LFT].width = settings.scrollbars_size; scrollbar_xsh_local[SB_WND_LFT].height = tray_data.xsh.height - offset * 2; scrollbar_xsh_local[SB_WND_RHT] = scrollbar_xsh_local[SB_WND_LFT]; scrollbar_xsh_local[SB_WND_RHT].x = tray_data.xsh.width - settings.scrollbars_size; } if (settings.scrollbars_mode & SB_MODE_VERT) { offset = (settings.vertical && (settings.scrollbars_mode & SB_MODE_HORZ)) ? settings.scrollbars_size : 0; scrollbar_xsh_local[SB_WND_TOP].x = offset; scrollbar_xsh_local[SB_WND_TOP].y = 0; scrollbar_xsh_local[SB_WND_TOP].width = tray_data.xsh.width - offset * 2; scrollbar_xsh_local[SB_WND_TOP].height = settings.scrollbars_size; scrollbar_xsh_local[SB_WND_BOT] = scrollbar_xsh_local[SB_WND_TOP]; scrollbar_xsh_local[SB_WND_BOT].y = tray_data.xsh.height - settings.scrollbars_size; } for (i = 0; i < SB_WND_MAX; i++) if (tray_data.scrollbars_data.scrollbar[i] != None && (!initialized || (scrollbar_xsh_local[i].x != tray_data.scrollbars_data.scrollbar_xsh[i].x || scrollbar_xsh_local[i].y != tray_data.scrollbars_data.scrollbar_xsh[i].y || scrollbar_xsh_local[i].width != tray_data.scrollbars_data.scrollbar_xsh[i].width || scrollbar_xsh_local[i].height != tray_data.scrollbars_data.scrollbar_xsh[i].height))) { XMoveResizeWindow(tray_data.dpy, tray_data.scrollbars_data.scrollbar[i], scrollbar_xsh_local[i].x, scrollbar_xsh_local[i].y, scrollbar_xsh_local[i].width, scrollbar_xsh_local[i].height); tray_data.scrollbars_data.scrollbar_xsh[i] = scrollbar_xsh_local[i]; } initialized = 1; return x11_ok(); } int scrollbars_get_id(Window wid, int x, int y) { int i; for (i = 0; i < SB_WND_MAX; i++) if (wid == tray_data.scrollbars_data.scrollbar[i] && 0 <= x && 0 <= y && x < tray_data.scrollbars_data.scrollbar_xsh[i].width && y < tray_data.scrollbars_data.scrollbar_xsh[i].height) { return i; } return -1; } void scrollbars_validate_scroll_pos() { int layout_width, layout_height; int base_width, base_height; struct Point max_scroll_pos; layout_get_size(&layout_width, &layout_height); tray_calc_tray_area_size(tray_data.xsh.width, tray_data.xsh.height, &base_width, &base_height); max_scroll_pos.x = layout_width - base_width; max_scroll_pos.y = layout_height - base_height; val_range(max_scroll_pos.x, 0, INT_MAX); val_range(max_scroll_pos.y, 0, INT_MAX); LOG_TRACE(("computed max scroll position: %dx%d\n", max_scroll_pos.x, max_scroll_pos.y)); val_range(tray_data.scrollbars_data.scroll_pos.x, 0, max_scroll_pos.x); val_range(tray_data.scrollbars_data.scroll_pos.y, 0, max_scroll_pos.y); } int scrollbars_click(int id) { /* TODO: implement scroll gravity (i.e. scroll weel must scroll in direction that agrees with * current tray orientation) */ /* TODO: scrollbars_inc must be settable via cmdline */ /* last entry is for action that just sanitizes current scroll * position after icon removal */ static struct Point scrollbars_deltas[SB_WND_MAX + 1] = { {0, -1}, {0, 1}, {-1, 0}, {1, 0}, {0, 0} }; tray_data.scrollbars_data.scroll_pos.x += (settings.icon_gravity & GRAV_W ? 1 : -1) * scrollbars_deltas[id].x * settings.scrollbars_inc; tray_data.scrollbars_data.scroll_pos.y += (settings.icon_gravity & GRAV_N ? 1 : -1) * scrollbars_deltas[id].y * settings.scrollbars_inc; scrollbars_validate_scroll_pos(); LOG_TRACE(("computed new scroll position: %dx%d\n", tray_data.scrollbars_data.scroll_pos.x, tray_data.scrollbars_data.scroll_pos.y)); icon_list_forall(&layout_translate_to_window); embedder_update_positions(id != SB_WND_MAX); return SUCCESS; } void scrollbars_handle_event(XEvent ev) { int id; switch (ev.type) { case EnterNotify: case LeaveNotify: LOG_TRACE(("EnterNotify, wid=0x%x x=%d y=%d\n", ev.type == EnterNotify ? "EnterNotify" : "LeaveNotify", ev.xcrossing.window, ev.xcrossing.x, ev.xcrossing.y)); if (settings.scrollbars_highlight_color_str != NULL && (id = scrollbars_get_id(ev.xcrossing.window, 0, 0)) != -1) { if (ev.type == EnterNotify) scrollbars_highlight_on(id); else scrollbars_highlight_off(id); } break; case ButtonPress: LOG_TRACE(("ButtonPress, state=0x%x\n", ev.xbutton.state)); if (ev.xbutton.button == Button1 && (id = scrollbars_get_id(ev.xbutton.window, ev.xbutton.x, ev.xbutton.y)) != -1) { tray_data.scrollbars_data.scrollbar_down = id; tray_data.scrollbars_data.scrollbar_repeat_active = 1; tray_data.scrollbars_data.scrollbar_repeat_counter = SCROLLBAR_REPEAT_COUNTDOWN_MAX_1ST; tray_data.scrollbars_data.scrollbar_repeats_done = 0; } break; case MotionNotify: LOG_TRACE(("MotionNotify, state=0x%x\n", ev.xbutton.state)); tray_data.scrollbars_data.scrollbar_repeat_active = (tray_data.scrollbars_data.scrollbar_down != -1 && scrollbars_get_id(ev.xmotion.window, ev.xmotion.x, ev.xmotion.y) == tray_data.scrollbars_data.scrollbar_down); break; case ButtonRelease: LOG_TRACE(("ButtonRelease, state=0x%x\n", ev.xbutton.state)); switch (ev.xbutton.button) { case Button1: if (tray_data.scrollbars_data.scrollbar_down != -1) { #if 0 /* If no repeats were done, advance scroll position */ if ((scrollbars_get_id(ev.xbutton.window, ev.xbutton.x, ev.xbutton.y) != -1) && (tray_data.scrollbars_data.scrollbar_repeats_done == 0)) { scrollbars_click(tray_data.scrollbars_data.scrollbar_down); } #endif tray_data.scrollbars_data.scrollbar_down = -1; tray_data.scrollbars_data.scrollbar_repeat_active = 0; } break; case Button4: if (settings.vertical && settings.scrollbars_mode & SB_MODE_VERT) scrollbars_click(SB_WND_TOP); else if (settings.scrollbars_mode & SB_MODE_HORZ) scrollbars_click(SB_WND_LFT); break; case Button5: if (settings.vertical && settings.scrollbars_mode & SB_MODE_VERT) scrollbars_click(SB_WND_BOT); else if (settings.scrollbars_mode & SB_MODE_HORZ) scrollbars_click(SB_WND_RHT); break; default: break; } break; } } void scrollbars_periodic_tasks() { if (tray_data.scrollbars_data.scrollbar_down != -1 && tray_data.scrollbars_data.scrollbar_repeat_active) { scrollbars_click(tray_data.scrollbars_data.scrollbar_down); } } int scrollbars_scroll_to(struct TrayIcon *ti) { struct Rect tray_viewport_rect; tray_viewport_rect.x = tray_data.scrollbars_data.scroll_base.x, tray_viewport_rect.y = tray_data.scrollbars_data.scroll_base.y, tray_calc_tray_area_size(tray_data.xsh.width, tray_data.xsh.height, &tray_viewport_rect.w, &tray_viewport_rect.h); /* Check if icon is already visible. If so, nothing needs to be done */ if (RECTS_ISECT(tray_viewport_rect, ti->l.icn_rect)) return SUCCESS; /* Update scroll pos so that the icon is visible */ /* TODO: must be in separate function, with a reverse */ tray_data.scrollbars_data.scroll_pos.x = (settings.icon_gravity & GRAV_W ? 1 : -1) * (ti->l.icn_rect.x - tray_data.scrollbars_data.scroll_base.x); tray_data.scrollbars_data.scroll_pos.y = (settings.icon_gravity & GRAV_W ? 1 : -1) * (ti->l.icn_rect.y - tray_data.scrollbars_data.scroll_base.y); scrollbars_validate_scroll_pos(); LOG_TRACE(("computed required scroll position: %dx%d\n", tray_data.scrollbars_data.scroll_pos.x, tray_data.scrollbars_data.scroll_pos.y)); icon_list_forall(&layout_translate_to_window); embedder_update_positions(True); return SUCCESS; } int scrollbars_highlight_on(int id) { Window sb_wid; sb_wid = (0 <= id && id < 4) ? tray_data.scrollbars_data.scrollbar[id] : None; if (sb_wid != None) XSetWindowBackground(tray_data.dpy, sb_wid, settings.scrollbars_highlight_color.pixel); scrollbars_refresh(1); } int scrollbars_highlight_off(int id) { Window sb_wid; sb_wid = (0 <= id && id < 4) ? tray_data.scrollbars_data.scrollbar[id] : None; if (sb_wid != None) XSetWindowBackgroundPixmap(tray_data.dpy, sb_wid, ParentRelative); scrollbars_refresh(1); } stalonetray-0.8.3/src/main.c0000644000175000017500000006557312475441207015044 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * main.c * Tue, 24 Aug 2004 12:19:48 +0700 * ------------------------------- * main is main * -------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #ifdef DEBUG #if defined(HAVE_BACKTRACE) #include #elif defined(HAVE_PRINTSTACK) #include #endif #endif #include "common.h" #include "debug.h" #include "icons.h" #include "layout.h" #include "embed.h" #include "xembed.h" #include "xutils.h" #include "wmh.h" #ifndef NO_NATIVE_KDE #include "kde_tray.h" #endif #include "settings.h" #include "scrollbars.h" #include "tray.h" struct TrayData tray_data; static int tray_status_requested = 0; #ifdef ENABLE_GRACEFUL_EXIT_HACK static Display *async_dpy; #endif void my_usleep(useconds_t usec) { struct timeval timeout; fd_set rfds; FD_ZERO(&rfds); timeout.tv_sec = 0; timeout.tv_usec = usec; select(1, &rfds, NULL, NULL, &timeout); } /**************************** * Signal handlers, cleanup ***************************/ void request_tray_status_on_signal(int sig) { tray_status_requested = 1; } #ifdef ENABLE_GRACEFUL_EXIT_HACK void exit_on_signal(int sig) { if (sig == SIGPIPE) { debug_disable_output(); } else { psignal(sig, ""); /* This is UGLY and is, probably, to be submitted to * Daily WTF, but it is the only way I found not to * use usleep in main event loop. */ LOG_TRACE(("Sending fake WM_DELETE_WINDOW message\n")); } x11_send_client_msg32(async_dpy, tray_data.tray, tray_data.tray, tray_data.xa_wm_protocols, tray_data.xa_wm_delete_window, 0, 0, 0, 0); XSync(async_dpy, False); } #endif void cleanup() { static int clean = 0; static int cleanup_in_progress = 0; if (!clean && cleanup_in_progress) { LOG_ERROR(("forced to die\n")); abort(); } if (clean) return; cleanup_in_progress = 1; if (tray_data.dpy != NULL && x11_connection_status()) { LOG_TRACE(("being nice to the icons\n")); /* Clean the list unembedding icons one by one */ icon_list_clean_callback(&embedder_unembed); /* Give away the selection */ if (tray_data.is_active) XSetSelectionOwner(tray_data.dpy, tray_data.xa_tray_selection, None, CurrentTime); /* Sync in order to wait until all icons finish their reparenting * process */ XSync(tray_data.dpy, False); XCloseDisplay(tray_data.dpy); tray_data.dpy = NULL; } cleanup_in_progress = 0; clean = 1; } /************************************** * Helper functions **************************************/ /* Print tray status */ void dump_tray_status() { int grid_w, grid_h; tray_status_requested = 0; layout_get_size(&grid_w, &grid_h); LOG_INFO(("----------- tray status -----------\n")); LOG_INFO(("active: %s\n", tray_data.is_active ? "yes" : "no")); LOG_INFO(("geometry: %dx%d+%d+%d\n", tray_data.xsh.width, tray_data.xsh.height, tray_data.xsh.x, tray_data.xsh.y)); if (tray_data.xembed_data.current) LOG_INFO(("XEMBED focus: 0x%x\n", tray_data.xembed_data.current->wid)); else LOG_INFO(("XEMBED focus: none\n")); LOG_INFO(("currently managed icons:\n")); icon_list_forall(&print_icon_data); LOG_INFO(("-----------------------------------\n")); } /************************************** * (Un)embedding cycle implementation **************************************/ /* Add icon to the tray */ void add_icon(Window w, int cmode) { struct TrayIcon *ti; /* Aviod adding duplicates */ if ((ti = icon_list_find(w)) != NULL) { LOG_TRACE(("ignoring second request to embed 0x%x" "(requested cmode=%d, current cmode=%d\n", w, cmode, ti->cmode)); return; } /* Dear Edsger W. Dijkstra, I see you behind my back =( */ if ((ti = icon_list_new(w, cmode)) == NULL) goto failed0; LOG_TRACE(("starting embedding for icon 0x%x, cmode=%d\n", w, cmode)); x11_dump_win_info(tray_data.dpy, w); /* Start embedding cycle */ if (!xembed_check_support(ti)) goto failed1; if (ti->is_xembed_supported) ti->is_visible = xembed_get_mapped_state(ti); else ti->is_visible = True; if (ti->is_visible) { if (!embedder_reset_size(ti)) goto failed1; if (!layout_add(ti)) goto failed1; } if (!xembed_embed(ti)) goto failed1; if (!embedder_embed(ti)) goto failed2; embedder_update_positions(False); tray_update_window_props(); /* Report success */ LOG_INFO(("added icon %s (wid 0x%x) as %s\n", x11_get_window_name(tray_data.dpy, ti->wid, ""), ti->wid, ti->is_visible ? "visible" : "hidden")); goto ok; failed2: layout_remove(ti); failed1: icon_list_free(ti); failed0: LOG_INFO(("failed to add icon %s (wid 0x%x)\n", x11_get_window_name(tray_data.dpy, ti->wid, ""), ti->wid)); ok: if (settings.log_level >= LOG_LEVEL_TRACE) dump_tray_status(); return; } /* Remove icon from the tray */ void remove_icon(Window w) { struct TrayIcon *ti; char *name; /* Ignore false alarms */ if ((ti = icon_list_find(w)) == NULL) return; dump_tray_status(); embedder_unembed(ti); xembed_unembed(ti); layout_remove(ti); icon_list_free(ti); LOG_INFO(("removed icon %s (wid 0x%x)\n", x11_get_window_name(tray_data.dpy, ti->wid, ""), w)); /* no need to call embedde_update_positions(), as * scrollbars_click(SB_WND_MAX) will call it */ /* XXX: maybe we need a different name for this * routine instad of passing cryptinc constant? */ scrollbars_click(SB_WND_MAX); tray_update_window_props(); dump_tray_status(); } /* Track icon visibility state changes */ void icon_track_visibility_changes(Window w) { struct TrayIcon *ti; int mapped; /* Ignore false alarms */ if ((ti = icon_list_find(w)) == NULL || !ti->is_xembed_supported) return; mapped = xembed_get_mapped_state(ti); LOG_TRACE(("xembed_is_mapped(0x%x) = %u\n", w, mapped)); LOG_TRACE(("is_visible = %u\n", ti->is_visible)); #ifdef DEBUG x11_dump_win_info(tray_data.dpy, ti->wid); #endif /* Nothing has changed */ if (mapped == ti->is_visible) return; ti->is_visible = mapped; LOG_INFO(("%s icon 0x%x\n", mapped ? "showing" : "hiding", w)); if (mapped) { /* Icon has become mapped and is listed as hidden. Show this icon. */ embedder_reset_size(ti); if (!layout_add(ti)) { xembed_set_mapped_state(ti, False); return; } embedder_show(ti); } else { /* Icon has become unmapped and is listed as visible. Hide this icon. */ layout_remove(ti); embedder_hide(ti); } embedder_update_positions(False); tray_update_window_props(); } /* helper to identify invalid icons */ int find_invalid_icons(struct TrayIcon *ti) { return ti->is_invalid; } #ifndef NO_NATIVE_KDE /* Find newly available KDE icons and add them as necessary */ /* TODO: move to kde_tray.c */ void kde_icons_update() { unsigned long list_len, i; Window *kde_tray_icons; if (tray_data.kde_tray_old_mode || !x11_get_root_winlist_prop(tray_data.dpy, tray_data.xa_kde_net_system_tray_windows, (unsigned char **) &kde_tray_icons, &list_len)) { return; } for (i = 0; i < list_len; i++) /* If the icon is not None and is non old, try to add it * (if the icon is already there, nothing is gonna happen). */ if (kde_tray_icons[i] != None && !kde_tray_is_old_icon(kde_tray_icons[i])) { LOG_TRACE(("found (possibly unembedded) KDE icon %s (wid 0x%x)\n", x11_get_window_name(tray_data.dpy, kde_tray_icons[i], ""), kde_tray_icons[i])); add_icon(kde_tray_icons[i], CM_KDE); } XFree(kde_tray_icons); } #endif #define PT_MASK_SB (1L << 0) #define PT_MASK_ALL PT_MASK_SB /* Perform several periodic tasks */ void perform_periodic_tasks(int mask) { struct TrayIcon *ti; /* 1. Remove all invalid icons */ while ((ti = icon_list_forall(&find_invalid_icons)) != NULL) { LOG_TRACE(("icon 0x%x is invalid; removing\n", ti->wid)); remove_icon(ti->wid); } /* 2. Print tray status if asked to */ if (tray_status_requested) dump_tray_status(); /* 3. KLUDGE to fix window size on (buggy?) WMs */ if (settings.kludge_flags & KLUDGE_FIX_WND_SIZE) { /* KLUDGE TODO: resolve */ XWindowAttributes xwa; XGetWindowAttributes(tray_data.dpy, tray_data.tray, &xwa); if (!tray_data.is_reparented && (xwa.width != tray_data.xsh.width || xwa.height != tray_data.xsh.height)) { LOG_TRACE(("KLUDGE: fixing tray window size (current: %dx%d, required: %dx%d)\n", xwa.width, xwa.height, tray_data.xsh.width, tray_data.xsh.height)); tray_update_window_props(); } } /* 4. run scrollbars periodic tasks */ if (mask & PT_MASK_SB) scrollbars_periodic_tasks(); } /********************** * Event handlers **********************/ void expose(XExposeEvent ev) { if (ev.window == tray_data.tray && settings.parent_bg && ev.count == 0) tray_refresh_window(False); } void visibility_notify(XVisibilityEvent ev) { } void property_notify(XPropertyEvent ev) { #define TRACE_PROPS #if defined(DEBUG) && defined(TRACE_PROPS) char *atom_name; atom_name = XGetAtomName(tray_data.dpy, ev.atom); LOG_TRACE(("atom = %s\n", atom_name)); XFree(atom_name); #endif /* React on wallpaper change */ if (ev.atom == tray_data.xa_xrootpmap_id || ev.atom == tray_data.xa_xsetroot_id) { if (settings.transparent) tray_update_bg(True); if (settings.parent_bg || settings.transparent || settings.fuzzy_edges) tray_refresh_window(True); } #ifndef NO_NATIVE_KDE /* React on change of list of KDE icons */ if (ev.atom == tray_data.xa_kde_net_system_tray_windows) { if (tray_data.is_active) kde_icons_update(); else LOG_TRACE(("not updating KDE icons list: tray is not active\n")); kde_tray_update_old_icons(tray_data.dpy); } #endif /* React on WM (re)starts */ if (ev.atom == XInternAtom(tray_data.dpy, _NET_SUPPORTING_WM_CHECK, False)) { #ifdef DEBUG ewmh_list_supported_atoms(tray_data.dpy); #endif tray_set_wm_hints(); #ifndef NO_NATIVE_KDE kde_tray_update_fallback_mode(tray_data.dpy); #endif } /* React on _XEMBED_INFO changes of embedded icons * (currently used to track icon visibility status) */ if (ev.atom == tray_data.xembed_data.xa_xembed_info) { icon_track_visibility_changes(ev.window); } if (ev.atom == tray_data.xa_net_client_list) { Window *windows; unsigned long nwindows, rc, i; rc = x11_get_root_winlist_prop(tray_data.dpy, tray_data.xa_net_client_list, (unsigned char **) &windows, &nwindows); if (x11_ok() && rc) { tray_data.is_reparented = True; for(i = 0; i < nwindows; i++) if (windows[i] == tray_data.tray) { tray_data.is_reparented = False; break; } } if (nwindows) XFree(windows); LOG_TRACE(("tray was %sreparented\n", tray_data.is_reparented ? "" : "not ")); } } void reparent_notify(XReparentEvent ev) { struct TrayIcon *ti; ti = icon_list_find(ev.window); if (ti == NULL) return; /* Reparenting out of the tray is one of non-destructive * ways to end XEMBED protocol (see spec) */ if (ti->is_embedded && ti->mid_parent != ev.parent) { LOG_TRACE(("will now unembed 0x%x\n", ti->wid)); #ifdef DEBUG print_icon_data(ti); x11_dump_win_info(tray_data.dpy, ev.parent); #endif remove_icon(ev.window); } } void client_message(XClientMessageEvent ev) { int cmode = CM_FDO; struct TrayIcon *ti; #ifdef DEBUG /* Print neat message(s) about this event to aid debugging */ char *msg_type_name; msg_type_name = XGetAtomName(tray_data.dpy, ev.message_type); if (msg_type_name != NULL) { LOG_TRACE(("message \"%s\"\n", msg_type_name)); XFree(msg_type_name); } if (ev.message_type == tray_data.xa_wm_protocols) { msg_type_name = XGetAtomName(tray_data.dpy, ev.data.l[0]); if (msg_type_name != NULL) { LOG_TRACE(("WM_PROTOCOLS message type: %s\n", msg_type_name)); XFree(msg_type_name); } } #endif /* Graceful exit */ if (ev.message_type == tray_data.xa_wm_protocols && ev.data.l[0] == tray_data.xa_wm_delete_window && ev.window == tray_data.tray) { LOG_TRACE(("got WM_DELETE message, will now exit\n")); exit(0); // atexit will call cleanup() } /* Handle _NET_WM_PING */ if (ev.message_type == tray_data.xa_wm_protocols && ev.data.l[0] == tray_data.xa_net_wm_ping && ev.window == tray_data.tray) { LOG_TRACE(("got WM_PING message, sending it back\n")); XEvent reply; reply.xclient = ev; reply.xclient.window = DefaultRootWindow(tray_data.dpy); XSendEvent(tray_data.dpy, DefaultRootWindow(tray_data.dpy), False, (SubstructureNotifyMask|SubstructureRedirectMask), &reply); } /* Handle _NET_SYSTEM_TRAY_* messages */ if (ev.message_type == tray_data.xa_tray_opcode && tray_data.is_active) { LOG_TRACE(("this is the _NET_SYSTEM_TRAY_OPCODE(%lu) message\n", ev.data.l[1])); switch (ev.data.l[1]) { /* This is the starting point of NET SYSTEM TRAY protocol */ case SYSTEM_TRAY_REQUEST_DOCK: LOG_TRACE(("dockin' requested by window 0x%x, serving in a moment\n", ev.data.l[2])); #ifndef NO_NATIVE_KDE if (kde_tray_check_for_icon(tray_data.dpy, ev.data.l[2])) cmode = CM_KDE; if (kde_tray_is_old_icon(ev.data.l[2])) kde_tray_old_icons_remove(ev.data.l[2]); #endif add_icon(ev.data.l[2], cmode); break; /* We ignore these messages, since we do not show * any baloons anyways */ case SYSTEM_TRAY_BEGIN_MESSAGE: case SYSTEM_TRAY_CANCEL_MESSAGE: break; /* Below are special cases added by this implementation */ /* STALONETRAY_TRAY_DOCK_CONFIRMED is sent by stalonetray * to itself. (see embed.c) */ case STALONE_TRAY_DOCK_CONFIRMED: ti = icon_list_find(ev.data.l[2]); if (ti != NULL && !ti->is_embedded) { ti->is_embedded = True; LOG_TRACE(("embedding confirmed for icon 0x%x\n", ti->wid)); #ifdef DEBUG dump_tray_status(); #endif } tray_update_window_props(); break; /* Dump tray status on request */ case STALONE_TRAY_STATUS_REQUESTED: dump_tray_status(); break; /* Find icon and scroll to it if necessary */ case STALONE_TRAY_REMOTE_CONTROL: ti = icon_list_find(ev.window); if (ti == NULL) break; scrollbars_scroll_to(ti); #if 0 /* Quick hack */ { Window icon = ev.window; int rc; int x = ev.data.l[3], y = ev.data.l[4], depth = 0, idummy, i; int btn = ev.data.l[2]; Window win, root; unsigned int udummy, w, h; XGetGeometry(tray_data.dpy, icon, &root, &idummy, &idummy, &w, &h, &udummy, &udummy); LOG_TRACE(("wid=0x%x w=%d h=%d\n", icon, w, h)); x = (x == REMOTE_CLICK_POS_DEFAULT) ? w / 2 : x; y = (y == REMOTE_CLICK_POS_DEFAULT) ? h / 2 : y; /* 3.2. Find subwindow to execute click on */ win = x11_find_subwindow_at(tray_data.dpy, icon, &x, &y, depth); /* 3.3. Send mouse click(s) to target */ LOG_TRACE(("wid=0x%x btn=%d x=%d y=%d\n", win, btn, x, y)); #define SEND_BTN_EVENT(press, time) do { \ x11_send_button(tray_data.dpy, /* dispslay */ \ press, /* event type */ \ win, /* target window */ \ root, /* root window */ \ time, /* time */ \ btn, /* button */ \ Button1Mask << (btn - 1), /* state mask */ \ x, /* x coord (relative) */ \ y); /* y coord (relative) */ \ } while (0) for (i = 0; i < ev.data.l[0]; i++) { SEND_BTN_EVENT(1, x11_get_server_timestamp(tray_data.dpy, tray_data.tray)); my_usleep(250); SEND_BTN_EVENT(0, x11_get_server_timestamp(tray_data.dpy, tray_data.tray)); } #undef SEND_BTN_EVENT } #endif break; default: break; } } #ifdef DEBUG if (ev.message_type == tray_data.xa_tray_opcode && !tray_data.is_active) LOG_TRACE(("ignoring _NET_SYSTEM_TRAY_OPCODE(%lu) message because tray is not active\n", tray_data.is_active)); #endif } void destroy_notify(XDestroyWindowEvent ev) { if (!tray_data.is_active && ev.window == tray_data.old_selection_owner) { /* Old tray selection owner was destroyed. Take over selection ownership. */ tray_acquire_selection(); } else if (ev.window != tray_data.tray) { /* Try to remove icon from the tray */ remove_icon(ev.window); #ifndef NO_NATIVE_KDE } else if (kde_tray_is_old_icon(ev.window)) { /* Since X Server may reuse window ids, remove ev.window * from the list of old KDE icons */ kde_tray_old_icons_remove(ev.window); #endif } } void configure_notify(XConfigureEvent ev) { struct TrayIcon *ti; struct Point sz; XWindowAttributes xwa; if (ev.window == tray_data.tray) { /* Tray window was resized */ /* TODO: distinguish between synthetic and real configure notifies */ /* TODO: catch rejected configure requests */ /* XXX: Geometry stuff is a mess. Geometry * is specified in slots, but almost always is * stored in pixels... */ LOG_TRACE(("tray window geometry from event: %ux%u+%d+%d\n", ev.width, ev.height, ev.x, ev.y)); /* Sometimes, configure notifies come too late, so we fetch real geometry ourselves */ XGetWindowAttributes(tray_data.dpy, tray_data.tray, &xwa); x11_get_window_abs_coords(tray_data.dpy, tray_data.tray, &tray_data.xsh.x, &tray_data.xsh.y); LOG_TRACE(("tray window geometry from X11 calls: %dx%d+%d+%d\n", xwa.width, xwa.height, tray_data.xsh.x, tray_data.xsh.y)); tray_data.xsh.width = xwa.width; tray_data.xsh.height = xwa.height; /* Update icons positions */ /* XXX: internal API is bad. example below */ icon_list_forall(&layout_translate_to_window); embedder_update_positions(True); /* Adjust window background if necessary */ tray_update_bg(False); tray_refresh_window(True); tray_update_window_strut(); scrollbars_update(); } else if ((ti = icon_list_find(ev.window)) != NULL) { /* Some icon has resized its window */ /* KDE icons are not allowed to change their size. Reset icon size. */ if (ti->cmode == CM_KDE || settings.kludge_flags & KLUDGE_FORCE_ICONS_SIZE) { embedder_reset_size(ti); return; } if (settings.kludge_flags & KLUDGE_FORCE_ICONS_SIZE) return; /* Get new window size */ if (!x11_get_window_size(tray_data.dpy, ti->wid, &sz.x, &sz.y)) { embedder_unembed(ti); return; } LOG_TRACE(("icon 0x%x was resized, new size: %ux%u, old size: %ux%u\n", ev.window, sz.x, sz.y, ti->l.wnd_sz.x, ti->l.wnd_sz.y)); /* Check if the size has really changed */ if (sz.x == ti->l.wnd_sz.x && sz.y == ti->l.wnd_sz.y) return; ti->l.wnd_sz = sz; ti->is_resized = True; /* Do the job */ layout_handle_icon_resize(ti); embedder_refresh(ti); #ifdef DEBUG print_icon_data(ti); #endif embedder_update_positions(False); tray_update_window_props(); #ifdef DEBUG dump_tray_status(); #endif } } void selection_clear(XSelectionClearEvent ev) { /* Is it _NET_SYSTEM_TRAY selection? */ if (ev.selection == tray_data.xa_tray_selection) { /* Is it us who has lost the selection */ if (ev.window == tray_data.tray) { LOG_INFO(("another tray detected; deactivating\n")); tray_data.is_active = False; tray_data.old_selection_owner = XGetSelectionOwner(tray_data.dpy, tray_data.xa_tray_selection); if (!x11_ok()) { LOG_INFO(("could not find proper new tray; reactivating\n")); tray_acquire_selection(); }; LOG_TRACE(("new selection owner is 0x%x\n", tray_data.old_selection_owner)); XSelectInput(tray_data.dpy, tray_data.old_selection_owner, StructureNotifyMask); return; } else if (!tray_data.is_active) { /* Someone else has lost selection and tray is not active --- take over the selection */ LOG_INFO(("another tray exited; reactivating\n")); tray_acquire_selection(); } else { /* Just in case */ LOG_TRACE(("WEIRD: tray is active and someone else has lost tray selection\n")); } } } void map_notify(XMapEvent ev) { #ifndef NO_NATIVE_KDE /* Legacy scheme to handle KDE icons */ if (tray_data.kde_tray_old_mode) { struct TrayIcon *ti = icon_list_find_ex(ev.window); if (ti == NULL) { Window w = kde_tray_find_icon(tray_data.dpy, ev.window); if (w != None) { LOG_TRACE(("Legacy scheme for KDE icons: detected KDE icon 0x%x. Adding.\n", w)); add_icon(w, CM_KDE); /* TODO: remove some properties to trick ion3 so that it no longer thinks that w is a toplevel. * Candidates for removal: * - WM_STATE */ } } } #endif } void unmap_notify(XUnmapEvent ev) { struct TrayIcon *ti; ti = icon_list_find(ev.window); if (ti != NULL && !ti->is_invalid) { /* KLUDGE! sometimes icons occasionally * unmap their windows, but do _not_ destroy * them. We map those windows back */ /* XXX: not root caused */ LOG_TRACE(("Unmap icons KLUDGE executed for 0x%x\n", ti->wid)); XMapRaised(tray_data.dpy, ti->wid); if (!x11_ok()) ti->is_invalid = True; } } /*********************************************************/ /* main() for usual operation */ int tray_main(int argc, char **argv) { XEvent ev; /* Interpret those settings that need an open display */ interpret_settings(); #ifdef DEBUG ewmh_list_supported_atoms(tray_data.dpy); #endif /* Create and show tray window */ tray_create_window(argc, argv); tray_acquire_selection(); tray_show_window(); #ifndef NO_NATIVE_KDE kde_tray_init(tray_data.dpy); #endif xembed_init(); #ifndef NO_NATIVE_KDE kde_icons_update(); #endif /* Main event loop */ while ("my guitar gently wheeps") { /* This is ugly and extra dependency. But who cares? * Rationale: we want to block unless absolutely needed. * This way we ensure that stalonetray does not show up * in powertop (i.e. does not eat unnecessary power and * CPU cycles) * Drawback: handling of signals is very limited. XNextEvent() * does not if signal occurs. This means that graceful * exit on e.g. Ctrl-C cannot be implemented without hacks. */ while (XPending(tray_data.dpy) || tray_data.scrollbars_data.scrollbar_down == -1) { XNextEvent(tray_data.dpy, &ev); xembed_handle_event(ev); scrollbars_handle_event(ev); switch (ev.type) { case VisibilityNotify: LOG_TRACE(("VisibilityNotify (0x%x, state=%d)\n", ev.xvisibility.window, ev.xvisibility.state)); visibility_notify(ev.xvisibility); break; case Expose: LOG_TRACE(("Expose (0x%x)\n", ev.xexpose.window)); expose(ev.xexpose); break; case PropertyNotify: LOG_TRACE(("PropertyNotify(0x%x)\n", ev.xproperty.window)); property_notify(ev.xproperty); break; case DestroyNotify: LOG_TRACE(("DestroyNotify(0x%x)\n", ev.xdestroywindow.window)); destroy_notify(ev.xdestroywindow); break; case ClientMessage: LOG_TRACE(("ClientMessage(from 0x%x?)\n", ev.xclient.window)); client_message(ev.xclient); break; case ConfigureNotify: LOG_TRACE(("ConfigureNotify(0x%x)\n", ev.xconfigure.window)); configure_notify(ev.xconfigure); break; case MapNotify: LOG_TRACE(("MapNotify(0x%x)\n", ev.xmap.window)); map_notify(ev.xmap); break; case ReparentNotify: LOG_TRACE(("ReparentNotify(0x%x to 0x%x)\n", ev.xreparent.window, ev.xreparent.parent)); reparent_notify(ev.xreparent); break; case SelectionClear: LOG_TRACE(("SelectionClear (0x%x has lost selection)\n", ev.xselectionclear.window)); selection_clear(ev.xselectionclear); break; case SelectionNotify: LOG_TRACE(("SelectionNotify\n")); break; case SelectionRequest: LOG_TRACE(("SelectionRequest (from 0x%x to 0x%x)\n", ev.xselectionrequest.requestor, ev.xselectionrequest.owner)); break; case UnmapNotify: LOG_TRACE(("UnmapNotify(0x%x)\n", ev.xunmap.window)); unmap_notify(ev.xunmap); break; default: #if defined(DEBUG) && defined(TRACE_EVENTS) LOG_TRACE(("Unhandled event: %s, serial: %d, window: 0x%x\n", x11_event_names[ev.type], ev.xany.serial, ev.xany.window)); #endif break; } if (tray_data.terminated) goto bailout; /* Perform all periodic tasks but for scrollbars */ perform_periodic_tasks(PT_MASK_ALL & (~PT_MASK_SB)); } perform_periodic_tasks(PT_MASK_ALL); my_usleep(500000L); } bailout: LOG_TRACE(("Clean exit\n")); return 0; } /* main() for controlling stalonetray remotely */ int remote_main(int argc, char **argv) { Window tray, icon = None; int rc; int x, y, depth = 0, idummy, i; Window win, root; unsigned int udummy, w, h; tray_init_selection_atoms(); tray_create_phony_window(); LOG_TRACE(("name=\"%s\" btn=%d cnt=%d x=%d y=%d\n", settings.remote_click_name, settings.remote_click_btn, settings.remote_click_cnt, settings.remote_click_pos.x, settings.remote_click_pos.y)); tray = XGetSelectionOwner(tray_data.dpy, tray_data.xa_tray_selection); if (tray == None) return 255; /* 1. find window matching requested name */ icon = x11_find_subwindow_by_name(tray_data.dpy, tray, settings.remote_click_name); if (icon == None) return 127; /* 2. form a message to tray requesting it to show the icon */ rc = x11_send_client_msg32(tray_data.dpy, /* display */ tray, /* destination */ icon, /* window */ tray_data.xa_tray_opcode, /* atom */ settings.remote_click_cnt, /* data0 */ STALONE_TRAY_REMOTE_CONTROL, /* data1 */ settings.remote_click_btn, /* data2 */ settings.remote_click_pos.x, /* data3 */ settings.remote_click_pos.y /* data4 */ ); if (!rc) return 63; /* 3. Execute the click */ /* 3.1. Sort out click position */ XGetGeometry(tray_data.dpy, icon, &root, &idummy, &idummy, &w, &h, &udummy, &udummy); LOG_TRACE(("wid=0x%x w=%d h=%d\n", icon, w, h)); x = (settings.remote_click_pos.x == REMOTE_CLICK_POS_DEFAULT) ? w / 2 : settings.remote_click_pos.x; y = (settings.remote_click_pos.y == REMOTE_CLICK_POS_DEFAULT) ? h / 2 : settings.remote_click_pos.y; /* 3.2. Find subwindow to execute click on */ win = x11_find_subwindow_at(tray_data.dpy, icon, &x, &y, depth); /* 3.3. Send mouse click(s) to target */ LOG_TRACE(("wid=0x%x btn=%d x=%d y=%d\n", win, settings.remote_click_btn, x, y)); #define SEND_BTN_EVENT(press, time) do { \ x11_send_button(tray_data.dpy, /* dispslay */ \ press, /* event type */ \ win, /* target window */ \ root, /* root window */ \ time, /* time */ \ settings.remote_click_btn, /* button */ \ Button1Mask << (settings.remote_click_btn - 1), /* state mask */ \ x, /* x coord (relative) */ \ y); /* y coord (relative) */ \ } while (0) for (i = 0; i < settings.remote_click_cnt; i++) { SEND_BTN_EVENT(1, x11_get_server_timestamp(tray_data.dpy, tray_data.tray)); my_usleep(250); SEND_BTN_EVENT(0, x11_get_server_timestamp(tray_data.dpy, tray_data.tray)); } #undef SEND_BTN_EVENT return 0; } /* main() */ int main(int argc, char** argv) { /* Read settings */ tray_init(); read_settings(argc, argv); /* Register cleanup and signal handlers */ atexit(cleanup); signal(SIGUSR1, &request_tray_status_on_signal); #ifdef ENABLE_GRACEFUL_EXIT_HACK signal(SIGINT, &exit_on_signal); signal(SIGTERM, &exit_on_signal); signal(SIGPIPE, &exit_on_signal); #endif /* Open display */ if ((tray_data.dpy = XOpenDisplay(settings.display_str)) == NULL) DIE(("could not open display\n")); else LOG_TRACE(("Opened dpy %p\n", tray_data.dpy)); #ifdef ENABLE_GRACEFUL_EXIT_HACK if ((async_dpy = XOpenDisplay(settings.display_str)) == NULL) DIE(("could not open display\n")); else LOG_TRACE(("Opened async dpy %p\n", async_dpy)); #endif if (settings.xsync) XSynchronize(tray_data.dpy, True); x11_trap_errors(); /* Execute proper main() function */ if (settings.remote_click_name != NULL) return remote_main(argc, argv); else return tray_main(argc, argv); } stalonetray-0.8.3/src/layout.h0000644000175000017500000000327411257443515015431 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * layout.h * Tue, 24 Aug 2004 12:19:27 +0700 * ------------------------------- * Icon layout implementation * -------------------------------*/ #ifndef _LAYOUT_H_ #define _LAYOUT_H_ #include "icons.h" /* Gravity constants */ /* East gravity */ #define GRAV_E (1L << 0) /* West gravity */ #define GRAV_W (1L << 1) /* South gravity */ #define GRAV_S (1L << 2) /* North gravity */ #define GRAV_N (1L << 3) /* Shortcut for horisontal gravity */ #define GRAV_H (GRAV_W | GRAV_E) /* Shortcut for vertical gravity */ #define GRAV_V (GRAV_S | GRAV_N) /* Macros to test rect intersection */ /* Helpers */ #define RX1(r) (r.x) #define RY1(r) (r.y) #define RX2(r) (r.x + r.w - 1) #define RY2(r) (r.y + r.h - 1) #define RECTS_ISECT_(r1, r2) \ (((RX1(r1) <= RX1(r2) && RX1(r2) <= RX2(r1)) || \ (RX1(r1) <= RX2(r2) && RX2(r2) <= RX2(r1))) && \ ((RY1(r1) <= RY1(r2) && RY1(r2) <= RY2(r1)) || \ (RY1(r1) <= RY2(r2) && RY2(r2) <= RY2(r1)))) /* Macro itself */ #define RECTS_ISECT(r1, r2) (RECTS_ISECT_(r1,r2) || RECTS_ISECT_(r2,r1)) /* Add icon to layout */ int layout_add(struct TrayIcon *ti); /* Remove icon from layout */ int layout_remove(struct TrayIcon *ti); /* Relayout the icon which has changed its size */ int layout_handle_icon_resize(struct TrayIcon *ti); /* Get current layout dimensions */ void layout_get_size(int *width, int *height); /* Translate grid coordinates into window coordinates */ int layout_translate_to_window(struct TrayIcon *ti); /* Return next icon in tab chain */ struct TrayIcon *layout_next(struct TrayIcon *current); /* Return previous icon in tab chain */ struct TrayIcon *layout_prev(struct TrayIcon *current); #endif stalonetray-0.8.3/src/kde_tray.c0000644000175000017500000001222612461504712015701 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * kde_tray.c * Sun, 19 Sep 2004 12:31:10 +0700 * ------------------------------- * kde tray related routines * -------------------------------*/ #include #include #include #include "debug.h" #include "xutils.h" #include "kde_tray.h" /* This list holds "old" KDE icons, e.g. the icons that are (likely) to be * already embedded into some system tray and, therefore, are to be ignored. The * list is empty initially */ Window *old_kde_icons = NULL; unsigned long n_old_kde_icons = -1; int kde_tray_update_fallback_mode(Display *dpy) { /* Get the contents of KDE_NET_SYSTEM_TRAY_WINDOWS root window property. * All windows that are listed there are considered to be "old" KDE icons, * i.e. icons that are to be ignored on the tray startup. * If the property does not exist, fall back to old mode */ if (tray_data.xa_kde_net_system_tray_windows == None || !x11_get_root_winlist_prop(dpy, tray_data.xa_kde_net_system_tray_windows, (unsigned char **) &old_kde_icons, &n_old_kde_icons)) { LOG_INFO(("WM does not support KDE_NET_SYSTEM_TRAY_WINDOWS, will use legacy scheme\n")); x11_extend_root_event_mask(tray_data.dpy, SubstructureNotifyMask); tray_data.kde_tray_old_mode = 1; } else { tray_data.kde_tray_old_mode = 0; } return tray_data.kde_tray_old_mode; } void kde_tray_init(Display *dpy) { unsigned long n_client_windows, i; Window *client_windows; Atom xa_net_client_list; if (!kde_tray_update_fallback_mode(dpy)) return; /* n_old_kde_icons == -1 iff this is the first time this function is called * with fallback mode disabled */ if (n_old_kde_icons != -1) return; /* 1. If theres no previous tray selection owner, try to embed all available * KDE icons and, therefore, leave the list of old KDE icons empty */ if (tray_data.old_selection_owner == None) { n_old_kde_icons = 0; return; } /* 2.Next, we are going to remove some entries from old_kde_icons list */ /* 2.a. First, we remove all icons that are listed in _NET_CLIENT_LIST property, * since this means that they are not embedded in any kind of tray */ xa_net_client_list = XInternAtom(dpy, "_NET_CLIENT_LIST", True); if (x11_get_root_winlist_prop(dpy, xa_net_client_list, (unsigned char **) &client_windows, &n_client_windows)) { for (i = 0; i < n_client_windows; i++) kde_tray_old_icons_remove(client_windows[i]); } /* 2.b. Second, we remove all windows that have root window as their parent, * since this also means that they are not embedded in any kind of tray */ for (i = 0; i < n_old_kde_icons; i++) { Window root, parent, *children; unsigned int nchildren; int rc; nchildren = 0; children = NULL; if ((rc = XQueryTree(dpy, old_kde_icons[i], &root, &parent, &children, &nchildren))) { if (root == parent) old_kde_icons[i] = None; if (nchildren > 0) XFree(children); } if (!x11_ok() || !rc) old_kde_icons[i] = None; } #ifdef DEBUG /* Some diagnostic output */ for (i = 0; i < n_old_kde_icons; i++) if (old_kde_icons[i] != None) LOG_TRACE(("0x%x is marked as an old KDE icon\n", old_kde_icons[i])); #endif } int kde_tray_update_old_icons(Display *dpy) { int i, rc; XWindowAttributes xwa; /* Remove dead entries from old kde icons list. * We use XGetWindowAttributes to see if the * window is still alive */ for (i = 0; i < n_old_kde_icons; i++) { rc = XGetWindowAttributes(dpy, old_kde_icons[i], &xwa); if (!x11_ok() || !rc) old_kde_icons[i] = None; } return SUCCESS; } int kde_tray_is_old_icon(Window w) { int i; for (i = 0; i < n_old_kde_icons; i++) if (old_kde_icons[i] == w) return True; return False; } void kde_tray_old_icons_remove(Window w) { int i; for (i = 0; i < n_old_kde_icons; i++) if (old_kde_icons[i] == w) { LOG_TRACE(("0x%x unmarked as an old kde icon\n", w)); old_kde_icons[i] = None; } } int kde_tray_check_for_icon(Display *dpy, Window w) { Atom actual_type; int actual_format; unsigned long nitems, bytes_after; static Atom xa_kde_net_wm_system_tray_window_for = None; unsigned char *data = NULL; /* Check if the window has a property named _KDE_NET_WM_SYSTEM_TRAY_WINDOW FOR */ if (xa_kde_net_wm_system_tray_window_for == None) xa_kde_net_wm_system_tray_window_for = XInternAtom(dpy, "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", True); /* If this atom does not exist, we have nothing to check for */ if (xa_kde_net_wm_system_tray_window_for == None) return False; /* TODO: use x11_ call */ XGetWindowProperty(dpy, w, xa_kde_net_wm_system_tray_window_for, 0L, 1L, False, XA_WINDOW, &actual_type, &actual_format, &nitems, &bytes_after, &data); XFree(data); if (x11_ok() && actual_type == XA_WINDOW && nitems == 1) return SUCCESS; else return FAILURE; } Window kde_tray_find_icon(Display *dpy, Window w) { Window root, parent, *children = NULL; unsigned int nchildren; int i; Window r = None; if (kde_tray_check_for_icon(dpy, w)) return w; XQueryTree(dpy, w, &root, &parent, &children, &nchildren); if (!x11_ok()) goto bailout; for (i = 0; i < nchildren; i++) if ((r = kde_tray_find_icon(dpy, children[i])) != None) goto bailout; bailout: if (children != NULL && nchildren > 0) XFree(children); return r; } stalonetray-0.8.3/src/layout.c0000644000175000017500000004477112461504712015426 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * layout.c * Tue, 24 Aug 2004 12:19:48 +0700 * ------------------------------- * Icon layout implementation. * (Used to be) the dirtiest place around. * -------------------------------*/ #include #include #include #include "config.h" #include "common.h" #include "layout.h" #include "debug.h" #include "icons.h" #include "tray.h" #include "list.h" /* not very nice (and calculates its arguments twice!), but allows doing things like swap(*a, *b) */ #define swap(a,b) do { int t; t = (a); (a) = (b); (b) = t; } while (0) /***************** * Grid interface * *****************/ struct Point grid_sz = {0, 0}; int grid_add(struct TrayIcon *ti); int grid_add_wrapper(struct TrayIcon *ti); int grid_remove(struct TrayIcon *ti); int grid_update(struct TrayIcon *ti, int sort); int grid_translate_from_window(struct TrayIcon *ti); int layout_translate_to_window(struct TrayIcon *ti); int layout_unset_flag(struct TrayIcon *ti); /************************ * Layout implementation * ************************/ int layout_add(struct TrayIcon *ti) { if (grid_add(ti)) { grid_update(ti, True); return SUCCESS; } else return FAILURE; } int layout_remove(struct TrayIcon *ti) { return ti->is_layed_out ? grid_remove(ti) : SUCCESS; } int layout_handle_icon_resize(struct TrayIcon *ti) { struct Rect old_grd_rect; struct Point old_grid_sz; int rc; #ifdef DEBUG if (settings.log_level >= LOG_LEVEL_TRACE) { LOG_TRACE(("currently managed icons:\n")); icon_list_forall(&print_icon_data); } #endif if (!icon_list_backup()) return FAILURE; old_grid_sz = grid_sz; if (ti->is_layed_out) { /* if the icon is already layed up and * its grid rect did not change we do nothing, * since its position inside grid cell will be * updated by embedder_update_positions */ old_grd_rect = ti->l.grd_rect; grid_translate_from_window(ti); if (ti->l.grd_rect.w == old_grd_rect.w && ti->l.grd_rect.h == old_grd_rect.h) { icon_list_backup_purge(); return SUCCESS; } } /* Here's the place where icon sorting start playing its role. * It is easy to see that resizing ti affects only those icons * that are after ti in the icon list. */ /* 1. Unset layout flags of all icons after ti */ icon_list_forall_from(ti, &layout_unset_flag); /* 2. If shrink mode is on, recalculate the size of the grid * for the remaining icons. This ensures that final grid * will be "minimal" (I did not prove that :) */ if (settings.shrink_back_mode) grid_update(ti, False); #ifdef DEBUG if (settings.log_level >= LOG_LEVEL_TRACE) { LOG_TRACE(("list of icons which are to be added back to the grid\n")); icon_list_forall_from(ti, &print_icon_data); } #endif /* 3. Start adding icons after ti back to the grid one * by one. If this fails for some icon, forall_icons_from() * will return non-NULL value and this will be considered * as a error condition */ if (icon_list_forall_from(ti, &grid_add_wrapper) == NULL) { /* Everything is OK */ icon_list_backup_purge(); grid_update(ti, True); rc = SUCCESS; } else { /* Error has occured */ icon_list_restore(); grid_sz = old_grid_sz; rc = FAILURE; } #ifdef DEBUG if (settings.log_level >= LOG_LEVEL_TRACE) { LOG_TRACE(("currently managed icons:\n")); icon_list_forall(&print_icon_data); } #endif return rc; } void layout_get_size(int *width, int *height) { *width = grid_sz.x * settings.slot_size; *height = grid_sz.y * settings.slot_size; if (settings.vertical) swap((*width), (*height)); } struct TrayIcon *layout_next(struct TrayIcon *current) { if ((settings.icon_gravity & GRAV_H) == GRAV_W) return icon_list_next(current); else return icon_list_prev(current); } struct TrayIcon *layout_prev(struct TrayIcon *current) { if ((settings.icon_gravity & GRAV_H) == GRAV_W) return icon_list_prev(current); else return icon_list_next(current); } /********************** * Grid implementation * **********************/ /* Structure to hold possible placement for an icon */ struct IconPlacement { struct Point pos; /* Position */ struct Point sz_delta; /* Layout size delta */ int valid; /* Is the placement valid */ }; /* Find best placement for an icon */ struct IconPlacement *grid_find_placement(struct TrayIcon *ti); /* Place tray icon as specified by ip */ int grid_place_icon(struct TrayIcon *ti, struct IconPlacement *ip); /* Comparison function for icon_list_sort */ int trayicon_cmp_func(struct TrayIcon *ti1, struct TrayIcon *ti2); /* Update grid dimentions */ int grid_recalc_size(struct TrayIcon *ti); /* A. Coords translations */ int grid_translate_from_window(struct TrayIcon *ti) { ti->l.grd_rect.w = ti->l.wnd_sz.x / settings.slot_size + (ti->l.wnd_sz.x % settings.slot_size != 0); \ ti->l.grd_rect.h = ti->l.wnd_sz.y / settings.slot_size + (ti->l.wnd_sz.y % settings.slot_size != 0); \ if (settings.vertical) swap(ti->l.grd_rect.w, ti->l.grd_rect.h); return NO_MATCH; } int layout_translate_to_window(struct TrayIcon *ti) { struct Rect old_icn_rect = ti->l.icn_rect; if (!ti->is_layed_out) return NO_MATCH; /* Swap vert & horz dimentions temporarily */ if (settings.vertical) { swap(ti->l.grd_rect.w, ti->l.grd_rect.h); swap(ti->l.grd_rect.x, ti->l.grd_rect.y); } /* Compute icon position and dimensions */ if (settings.icon_gravity & GRAV_W) ti->l.icn_rect.x = ti->l.grd_rect.x * settings.slot_size; else ti->l.icn_rect.x = tray_data.xsh.width - (ti->l.grd_rect.x + ti->l.grd_rect.w) * settings.slot_size; if (settings.icon_gravity & GRAV_N) ti->l.icn_rect.y = ti->l.grd_rect.y * settings.slot_size; else ti->l.icn_rect.y = tray_data.xsh.height - (ti->l.grd_rect.y + ti->l.grd_rect.h) * settings.slot_size; ti->l.icn_rect.w = ti->l.grd_rect.w * settings.slot_size; ti->l.icn_rect.h = ti->l.grd_rect.h * settings.slot_size; /* Swap vert & horz dimentions back */ if (settings.vertical) { swap(ti->l.grd_rect.w, ti->l.grd_rect.h); swap(ti->l.grd_rect.x, ti->l.grd_rect.y); } /* Shift icon position according to scrollbars positions */ /* TODO: must be in separate function, with a reverse */ ti->l.icn_rect.x += ((settings.icon_gravity & GRAV_W ? 1 : -1) * (tray_data.scrollbars_data.scroll_base.x - tray_data.scrollbars_data.scroll_pos.x)); ti->l.icn_rect.y += ((settings.icon_gravity & GRAV_N ? 1 : -1) * (tray_data.scrollbars_data.scroll_base.y - tray_data.scrollbars_data.scroll_pos.y)); LOG_TRACE(("grid %dx%d+%d+%d -> window %dx%d+%d+%d\n", ti->l.grd_rect.w, ti->l.grd_rect.h, ti->l.grd_rect.x, ti->l.grd_rect.y, ti->l.icn_rect.w, ti->l.icn_rect.h, ti->l.icn_rect.x, ti->l.icn_rect.y)); /* Set flag indicating if new position is different from old */ ti->is_updated = ti->is_updated || !(ti->l.icn_rect.x == old_icn_rect.x && ti->l.icn_rect.y == old_icn_rect.y && ti->l.icn_rect.w == old_icn_rect.w && ti->l.icn_rect.h == old_icn_rect.h); return NO_MATCH; } /* B. Adding/removing icon from the grid */ int grid_add(struct TrayIcon *ti) { struct IconPlacement *pmt; /* Invalidate grid position data */ ti->l.grd_rect.x = -1; ti->l.grd_rect.y = -1; ti->l.grd_rect.w = -1; ti->l.grd_rect.h = -1; /* Invalidate window position data */ ti->l.icn_rect.x = -1; ti->l.icn_rect.y = -1; ti->l.icn_rect.w = -1; ti->l.icn_rect.h = -1; /* Get window dimensions */ grid_translate_from_window(ti); pmt = grid_find_placement(ti); if (pmt == NULL) { LOG_TRACE(("no candidates for placement found\n")); ti->is_layed_out = False; RETURN_STATUS(FAILURE); } ti->is_layed_out = True; grid_place_icon(ti, pmt); RETURN_STATUS(SUCCESS); } int grid_remove(struct TrayIcon *ti) { /* implementation is similar to that of layout_handle_icon_resize(), * see detailed description there */ icon_list_forall_from(ti, &layout_unset_flag); if (settings.shrink_back_mode || settings.scrollbars_mode != SB_MODE_NONE) grid_update(ti, False); /* Since NULL is a special case for icon_list_froall_from, * avoid calling it for the last icon */ if (ti->next != NULL) RETURN_STATUS(icon_list_forall_from(ti->next, &grid_add_wrapper) == NULL); else RETURN_STATUS(SUCCESS); } /* C. Grid manipulations */ int grid_update(struct TrayIcon *ti, int sort) { icon_list_forall_from(ti, &layout_translate_to_window); if (sort) icon_list_sort(&trayicon_cmp_func); /* recalculate minimal size */ grid_sz.x = 0; grid_sz.y = 0; icon_list_forall(&grid_recalc_size); LOG_TRACE(("final grid size: %dx%d\n", grid_sz.x, grid_sz.y)); return SUCCESS; } /* D. Placement functions */ int grid_place_icon(struct TrayIcon *ti, struct IconPlacement *ip) { struct Layout *l = &ti->l; struct Point *p = &ip->pos; /* Set the flag if icon position was really updated */ ti->is_updated = ti->is_updated || (p->x != l->grd_rect.x || p->y != l->grd_rect.y); if (ti->is_updated || !ti->is_layed_out) { LOG_TRACE(("updating position (%d,%d) to (%d,%d)\n", ti->l.grd_rect.x, ti->l.grd_rect.y, p->x, p->y)); l->grd_rect.x = p->x; l->grd_rect.y = p->y; } /* Update grid dimensions */ grid_sz.x += ip->sz_delta.x; grid_sz.y += ip->sz_delta.y; /* Update icon position */ layout_translate_to_window(ti); LOG_TRACE(("current grid size: %dx%d\n", grid_sz.x, grid_sz.y)); return ti->is_updated; } /* Oh, the wonders of languages without closures... */ static struct Rect chk_rect; /* Check if grid rect of ti intersects with chk_rect */ int find_obstacle(struct TrayIcon *ti) { return ti->is_layed_out && (RECTS_ISECT(chk_rect, ti->l.grd_rect) || RECTS_ISECT(ti->l.grd_rect, chk_rect)); } /* Check if grid rect of ti intersects with any other tray icon * grid rect and return its width or height, depending on tray orientation */ int grid_check_rect_free(int x, int y, int w, int h) { struct TrayIcon *obst; chk_rect.x = x; chk_rect.y = y; chk_rect.w = w; chk_rect.h = h; obst = icon_list_advanced_find(&find_obstacle); if (obst == NULL) { return 0; } else { if (settings.vertical) return obst->l.grd_rect.h; else return obst->l.grd_rect.w; } } /* Simple function to fill in fields of IconPlacement struct * x, y: position of the icon * rect: provides the size of the icon * return value: returns true if the placement is valid; returns false otherwise. */ int icon_placement_create(struct IconPlacement *ip, int x, int y, struct Rect *rect) { /* scrollbar & tray orientation-aware shortcuts for maximal layout dimensions. * if scrollbar is enabled in some direction, layout size in this dimension is not limited */ #define max_layout_width (settings.scrollbars_mode & SB_MODE_HORZ ? \ INT_MAX : \ ((settings.vertical ? settings.max_tray_dims.y : settings.max_tray_dims.x) / settings.slot_size)) #define max_layout_height (settings.scrollbars_mode & SB_MODE_VERT ? \ INT_MAX : \ ((settings.vertical ? settings.max_tray_dims.x : settings.max_tray_dims.y) / settings.slot_size)) ip->valid = 0; ip->pos.x = x; ip->pos.y = y; ip->sz_delta.x = x + rect->w - grid_sz.x; ip->sz_delta.y = y + rect->h - grid_sz.y; ip->sz_delta.x = ip->sz_delta.x > 0 ? ip->sz_delta.x : 0; ip->sz_delta.y = ip->sz_delta.y > 0 ? ip->sz_delta.y : 0; ip->valid = (ip->pos.x + rect->w <= max_layout_width) && (ip->pos.y + rect->h <= max_layout_height); #ifdef DEBUG LOG_TRACE(("placement (%d, %d, %d, %d) is %s\n", x, y, ip->sz_delta.x, ip->sz_delta.y, ip->valid ? "valid" : "invalid")); #endif return ip->valid; } /* Compare points in lexographical order */ #define compare_points(a,b) (((a).y < (b).y) || ((a).y == (b).y && (a).x < (b).x)) /* Choose best placement --- placement policy is defined here * Placement A is considered to be better than placement B * if either * - min_space_policy is on and (window) size delta for A is * strictly less then size delta for B; * - position for A is less (in lexographical order) * than position for B. * */ void icon_placement_choose_best(struct IconPlacement *old, struct IconPlacement *new) { int old_lout_delta_norm, new_lout_delta_norm; int lout_norm_cmp; struct Point new_wnd_sz_delta, old_wnd_sz_delta; int old_wnd_delta_norm = 0, new_wnd_delta_norm = 0; int wnd_norm_cmp = 0; /* I whish there were nested functions in C standard */ #define calc_wnd_sz_delta(delta,pmt) do { \ delta.x = cutoff((grid_sz.x + pmt->sz_delta.x) * settings.slot_size - tray_data.xsh.width, 0, pmt->sz_delta.x * settings.slot_size); \ delta.y = cutoff((grid_sz.y + pmt->sz_delta.y) * settings.slot_size - tray_data.xsh.height, 0, pmt->sz_delta.y * settings.slot_size); \ } while(0) /* If tray is vertically oriented, swap width <-> height * (just for readability sake) */ if (settings.vertical) { swap(tray_data.xsh.width, tray_data.xsh.height); swap(settings.orig_tray_dims.x, settings.orig_tray_dims.y); } calc_wnd_sz_delta(old_wnd_sz_delta, old); calc_wnd_sz_delta(new_wnd_sz_delta, new); /* Some black magic. This is probably buggy and you are not supposed to * understand this (I definetly don't). The basic idea is that sometimes * layout resize means window resize. Sometimes it does not. */ if (settings.shrink_back_mode) { if (grid_sz.x >= settings.orig_tray_dims.x / settings.slot_size) { old_wnd_sz_delta.x = old->sz_delta.x * settings.slot_size; new_wnd_sz_delta.x = new->sz_delta.x * settings.slot_size; } if (grid_sz.y >= settings.orig_tray_dims.y / settings.slot_size) { old_wnd_sz_delta.y = old->sz_delta.y * settings.slot_size; new_wnd_sz_delta.y = new->sz_delta.y * settings.slot_size; } } /* Restore values */ if (settings.vertical) { swap(tray_data.xsh.width, tray_data.xsh.height); swap(settings.orig_tray_dims.x, settings.orig_tray_dims.y); } LOG_TRACE(("old placement = (%d, %d, %d, %d, %d, %d)\n", old->pos.x, old->pos.y, old->sz_delta.x, old->sz_delta.y, old_wnd_sz_delta.x, old_wnd_sz_delta.y)); LOG_TRACE(("new placement = (%d, %d, %d, %d, %d, %d)\n", new->pos.x, new->pos.y, new->sz_delta.x, new->sz_delta.y, new_wnd_sz_delta.x, new_wnd_sz_delta.y)); /* Compute norms for window deltas */ old_wnd_delta_norm = old_wnd_sz_delta.x + old_wnd_sz_delta.y; new_wnd_delta_norm = new_wnd_sz_delta.x + new_wnd_sz_delta.y; wnd_norm_cmp = new_wnd_delta_norm < old_wnd_delta_norm; /* Compute norms for layout deltas */ old_lout_delta_norm = old->sz_delta.x + old->sz_delta.y; new_lout_delta_norm = new->sz_delta.x + new->sz_delta.y; lout_norm_cmp = new_lout_delta_norm < old_lout_delta_norm; LOG_TRACE(("old wnd delta norm = %d, lout delta norm = %d\n", old_wnd_delta_norm, old_lout_delta_norm)); LOG_TRACE(("new wnd delta norm = %d, lout delta norm = %d\n", new_wnd_delta_norm, new_lout_delta_norm)); LOG_TRACE(("lout norm cmp = %d, wnd norm cmp = %d\n", lout_norm_cmp, wnd_norm_cmp)); LOG_TRACE(("compare points (new, old) = %d\n", compare_points(new->pos, old->pos))); /* CORE of placement logic. In short, * - valid placement is always better than invalid * - with minimal space policy on (off by default), placement with smaller deltas is better * - placement which does not cause tray window to grow is always better than one that does * - otherwise, placement that is "closer" to initial point (that depends on gravity) is better */ if (!old->valid && new->valid) goto replace; if (settings.min_space_policy && (lout_norm_cmp || wnd_norm_cmp)) goto replace; if (old_lout_delta_norm && !new_lout_delta_norm) goto replace; if (old_wnd_delta_norm && !new_wnd_delta_norm) goto replace; if ((!old_lout_delta_norm == !new_lout_delta_norm) && compare_points(new->pos, old->pos)) goto replace; LOG_TRACE(("old placement is better\n")); return; replace: LOG_TRACE(("new placement is better\n")); *old = *new; } /* WARNING: returns ptr to STATIC buffer */ struct IconPlacement *grid_find_placement(struct TrayIcon *ti) { static struct IconPlacement cur_pmt; struct IconPlacement tmp_pmt; int x = 0, y = 0, skip, orig_layed_out; orig_layed_out = ti->is_layed_out; ti->is_layed_out = 0; /* to avoid self-intersections */ /* General idea is to look through all possible placements * while keeping one which is considered to be the "best" and * comparing current placement with "best" one and updating * it accordingly */ if (grid_sz.x == 0 || grid_sz.y == 0) { /* Grid is empty */ /* This is the only possible placement */ icon_placement_create(&cur_pmt, 0, 0, &ti->l.grd_rect); } else { /* Seek and place */ /* Create two obvious placements */ /* Rightmost-top position */ icon_placement_create(&cur_pmt, grid_sz.x, 0, &ti->l.grd_rect); /* Bottommost-left position */ icon_placement_create(&tmp_pmt, 0, grid_sz.y, &ti->l.grd_rect); /* Choose the best one */ icon_placement_choose_best(&cur_pmt, &tmp_pmt); /* Start looking through possible placements. * Current placement is determined by x and y variables. */ do { /* Check if the current rect is free */ skip = grid_check_rect_free(x, y, ti->l.grd_rect.w, ti->l.grd_rect.h); LOG_TRACE(("x=%d, y=%d, skip=%d\n", x, y, skip)); /* If so, create new placement */ if (skip == 0) { if (icon_placement_create(&tmp_pmt, x, y, &ti->l.grd_rect)) { icon_placement_choose_best(&cur_pmt, &tmp_pmt); /* If not settings.full_pmt_search, take the first valid * non-resizing placement and run */ if (!settings.full_pmt_search && !cur_pmt.sz_delta.x && !cur_pmt.sz_delta.y) break; } skip = ti->l.grd_rect.w; } /* Advance to the next possible placement */ x += skip; if (x >= grid_sz.x) { x = 0; y++; } } while (x < grid_sz.x && y < grid_sz.y); } /* Restore layed out state */ ti->is_layed_out = orig_layed_out; if (cur_pmt.valid) { LOG_TRACE(("using placement (%d, %d, %d, %d)\n", cur_pmt.pos.x, cur_pmt.pos.y, cur_pmt.sz_delta.x, cur_pmt.sz_delta.y)); return &cur_pmt; } else { return NULL; } } /* E. Mass-ops helpers */ int trayicon_cmp_func(struct TrayIcon *ti1, struct TrayIcon *ti2) { return (!ti2->is_layed_out && ti1->is_layed_out) || compare_points(ti2->l.grd_rect, ti1->l.grd_rect); } int grid_add_wrapper(struct TrayIcon *ti) { /* Ignore hidden icons */ return !ti->is_visible || grid_add(ti) ? NO_MATCH : MATCH; } int grid_recalc_size(struct TrayIcon *ti) { int x, y; /* Ignore icons that are not layed out */ if (!ti->is_layed_out) return NO_MATCH; /* Calculate coordinates for bottom-right corner of ti */ x = ti->l.grd_rect.x + ti->l.grd_rect.w; y = ti->l.grd_rect.y + ti->l.grd_rect.h; /* Update grid dimensions */ grid_sz.x = x > grid_sz.x ? x : grid_sz.x; grid_sz.y = y > grid_sz.y ? y : grid_sz.y; LOG_TRACE(("new grid size: %dx%d\n", grid_sz.x, grid_sz.y)); return NO_MATCH; } int layout_unset_flag(struct TrayIcon *ti) { ti->is_layed_out = 0; return NO_MATCH; } stalonetray-0.8.3/src/xembed.h0000644000175000017500000000274010751352066015353 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * icons.h * Tue, 24 Aug 2004 12:05:38 +0700 * ------------------------------- * XEMBED protocol implementation * -------------------------------*/ #ifndef _XEMBED_H_ #define _XEMBED_H_ #include #include "icons.h" /* Data structure for all XEMBED-related data for the tray */ struct XEMBEDData { struct TrayIcon *current; /* Pointer to the currently focused icon */ struct XEMBEDAccel *accels; /* List of registered XEMBED accelerators */ int window_has_focus; /* Flag: does tray's window have focus */ int focus_requested; /* Flag: if there is not completed focus request */ Window focus_proxy; /* Window ID of XEMBED focus proxy */ long timestamp; /* Timestamp of current processed message */ Atom xa_xembed_info; /* Atom: XEMBED_INFO */ Atom xa_xembed; /* Atom: XEMBED */ }; /* Initialize XEMBED data structures */ void xembed_init(); /* Event handling routine for XEMBED support */ void xembed_handle_event(XEvent ev); /* Check if icon ti supports XEMBED */ int xembed_check_support(struct TrayIcon *ti); /* Send XEMBED embedding acknowledgement to icon ti */ int xembed_embed(struct TrayIcon *ti); /* Same as above for unembedding */ int xembed_unembed(struct TrayIcon *ti); /* Get XEMBED mapped state from XEMBED info */ int xembed_get_mapped_state(struct TrayIcon *ti); /* Set XEMBED mapped state in XEMBED info */ int xembed_set_mapped_state(struct TrayIcon *ti, int state); #endif stalonetray-0.8.3/src/image.h0000644000175000017500000000144612461504712015170 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * image.h * Fri, 22 Jun 2007 23:32:27 +0700 * ------------------------------- * Simple XImage manipulation * interface * -------------------------------*/ #ifndef _IMAGE_H_ #define _IMAGE_H_ #include #include /* outstanding TODO (for 0.8): use Xrender when available */ /* WARNING: works with ZPixmaps only */ /* Creates alpha channel mask with specified fade-out order */ CARD8 *image_create_alpha_mask(int ord, int w, int h); /* Alpha-tint image using color. */ int image_tint(XImage *image, XColor *color, CARD8 alpha); /* Compose image stored in tgt with image stored in bg. * Alpha of each pixel is defined by mask, which should */ int image_compose(XImage *tgt, XImage *bg, CARD8 *mask); #endif stalonetray-0.8.3/src/embed.c0000644000175000017500000002217412461504712015156 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * embed.c * Fri, 03 Sep 2004 20:38:55 +0700 * ------------------------------- * embedding cycle implementation * -------------------------------*/ #include "config.h" #include #include #include #include #ifdef DELAY_EMBEDDING_CONFIRMATION #include #endif #include "embed.h" #include "common.h" #include "tray.h" #include "debug.h" #include "icons.h" #include "kde_tray.h" #include "settings.h" #include "xembed.h" #include "xutils.h" #define CALC_INNER_POS(x_, y_, ti_) do { \ x_ = (ti_->l.icn_rect.w - ti_->l.wnd_sz.x) / 2; \ y_ = (ti_->l.icn_rect.h - ti_->l.wnd_sz.y) / 2; \ } while (0); #ifdef DELAY_EMBEDDING_CONFIRMATION void *send_delayed_confirmation(void *dummy) { struct TrayIcon* ti = (struct TrayIcon *) dummy; Display *dpy; if ((dpy = XOpenDisplay(settings.display_str)) != NULL) { LOG_TRACE(("will now sleep for %d seconds\n", settings.confirmation_delay)); sleep(settings.confirmation_delay); LOG_TRACE(("sending embedding confirmation\n")); x11_send_client_msg32(dpy, tray_data.tray, tray_data.tray, tray_data.xa_tray_opcode, 0, STALONE_TRAY_DOCK_CONFIRMED, ti->wid, 0, 0); XSync(dpy, False); XClose(dpy); } else { DIE_IE(("failed to initialize display\n")); } pthread_exit(NULL); } #endif int embedder_embed(struct TrayIcon *ti) { int x, y, rc; XSetWindowAttributes xswa; /* If the icon is being embedded as hidden, * we just start listening for property changes * to track _XEMBED mapped state */ if (!ti->is_visible) { XSelectInput(tray_data.dpy, ti->wid, PropertyChangeMask); return x11_ok(); } /* 0. Start listening for events on icon window */ XSelectInput(tray_data.dpy, ti->wid, StructureNotifyMask | PropertyChangeMask); if (!x11_ok()) RETURN_STATUS(FAILURE); /* 1. Calculate position of mid-parent window */ CALC_INNER_POS(x, y, ti); LOG_TRACE(("position of icon 0x%x inside the tray: (%d, %d)\n", ti->wid, x, y)); /* 2. Create mid-parent window */ ti->mid_parent = XCreateSimpleWindow(tray_data.dpy, tray_data.tray, ti->l.icn_rect.x + x, ti->l.icn_rect.y + y, ti->l.wnd_sz.x, ti->l.wnd_sz.y, 0, 0, 0); /* 2.5. Setup mid-parent window properties */ xswa.win_gravity = settings.bit_gravity; XChangeWindowAttributes(tray_data.dpy, ti->mid_parent, CWWinGravity, &xswa); #ifndef DEBUG_HIGHLIGHT_MIDPARENT XSetWindowBackgroundPixmap(tray_data.dpy, ti->mid_parent, ParentRelative); #else XSetWindowBackgroundPixmap(tray_data.dpy, ti->mid_parent, 0); #endif if (!x11_ok() || ti->mid_parent == None) RETURN_STATUS(FAILURE); LOG_TRACE(("created mid-parent window 0x%x\n", ti->mid_parent)); /* 3. Embed window into mid-parent */ switch (ti->cmode) { case CM_KDE: case CM_FDO: XReparentWindow(tray_data.dpy, ti->wid, ti->mid_parent, 0, 0); XMapRaised(tray_data.dpy, ti->wid); break; default: break; } /* 4. Show mid-parent */ XMapWindow(tray_data.dpy, ti->mid_parent); /* mid-parent must be lowered so that it does not osbcure * scollbar windows */ XLowerWindow(tray_data.dpy, ti->mid_parent); if (!x11_ok()) RETURN_STATUS(FAILURE); #ifndef DELAY_EMBEDDING_CONFIRMATION /* 5. Send message confirming embedding */ rc = x11_send_client_msg32(tray_data.dpy, tray_data.tray, tray_data.tray, tray_data.xa_tray_opcode, 0, STALONE_TRAY_DOCK_CONFIRMED, ti->wid, 0, 0); RETURN_STATUS(rc != 0); #else /* This is here for debugging purposes */ { pthread_t delayed_thread; pthread_create(&delayed_thread, NULL, send_delayed_confirmation, (void *) ti); LOG_TRACE(("sent delayed confirmation\n")); RETURN_STATUS(SUCCESS); } #endif } int embedder_unembed(struct TrayIcon *ti) { if (!ti->is_embedded) return SUCCESS; switch (ti->cmode) { case CM_KDE: case CM_FDO: /* Unembed icon as described in system tray protocol */ if (ti->is_embedded) { XSelectInput(tray_data.dpy, ti->wid, NoEventMask); XUnmapWindow(tray_data.dpy, ti->wid); XReparentWindow(tray_data.dpy, ti->wid, DefaultRootWindow(tray_data.dpy), ti->l.icn_rect.x, ti->l.icn_rect.y); XMapRaised(tray_data.dpy, ti->wid); if (!x11_ok()) LOG_ERROR(("failed to move icon 0x%x out of the tray\n")); } /* Destroy mid-parent */ if (ti->mid_parent != None) { XDestroyWindow(tray_data.dpy, ti->mid_parent); if (!x11_ok()) LOG_ERROR(("failed to destroy icon mid-parent 0x%x\n", ti->mid_parent)); } break; default: LOG_ERR_IE(("Error: the compatibility mode %d is not supported (should not happen)\n", ti->cmode)); return FAILURE; } LOG_TRACE(("done unembedding 0x%x\n", ti->wid)); RETURN_STATUS(x11_ok() == 0); /* This resets error status for the generations to come (XXX) */ } int embedder_hide(struct TrayIcon *ti) { XUnmapWindow(tray_data.dpy, ti->mid_parent); /* We do not wany any StructureNotify events for icon window anymore */ XSelectInput(tray_data.dpy, ti->wid, PropertyChangeMask); if (!x11_ok()) { ti->is_invalid = True; return FAILURE; } else { ti->is_size_set = False; ti->num_size_resets = 0; ti->is_visible = False; return SUCCESS; } } int embedder_show(struct TrayIcon *ti) { unsigned int x, y; /* If the window has never been embedded, * perform real embedding */ if (ti->mid_parent == None) { ti->is_visible = True; return embedder_embed(ti); } /* 0. calculate new position for mid-parent */ CALC_INNER_POS(x, y, ti); /* 1. move mid-parent to new location */ XMoveResizeWindow(tray_data.dpy, ti->mid_parent, ti->l.icn_rect.x + x, ti->l.icn_rect.y + y, ti->l.wnd_sz.x, ti->l.wnd_sz.y); /* 2. adjust icon position inside mid-parent */ XMoveWindow(tray_data.dpy, ti->wid, 0, 0); /* 3. map icon ? */ XMapRaised(tray_data.dpy, ti->wid); /* 4. map mid-parent */ XMapWindow(tray_data.dpy, ti->mid_parent); XSelectInput(tray_data.dpy, ti->wid, StructureNotifyMask | PropertyChangeMask); if (!x11_ok()) { ti->is_invalid = True; return FAILURE; } else { ti->is_visible = True; return SUCCESS; } } static int update_forced = False; static int embedder_update_window_position(struct TrayIcon *ti) { int x, y; /* Ignore hidden icons */ if (!ti->is_visible) return NO_MATCH; /* Update only those icons that do want it (everyone if update was forced) */ if (!update_forced && !ti->is_updated && !ti->is_resized && ti->is_embedded) return NO_MATCH; LOG_TRACE(("Updating position of icon 0x%x\n", ti->wid)); /* Recalculate icon position */ CALC_INNER_POS(x, y, ti); /* Reset the flags */ ti->is_resized = False; ti->is_updated = False; /* Move mid-parent window */ XMoveResizeWindow(tray_data.dpy, ti->mid_parent, ti->l.icn_rect.x + x, ti->l.icn_rect.y + y, ti->l.wnd_sz.x, ti->l.wnd_sz.y); /* Sanitize icon position inside mid-parent */ XMoveWindow(tray_data.dpy, ti->wid, 0, 0); /* Refresh the icon */ embedder_refresh(ti); if (!x11_ok()) { LOG_TRACE(("failed to update position of icon 0x%x\n", ti->wid)); ti->is_invalid = True; } return NO_MATCH; } int embedder_update_positions(int forced) { /* I wish C had closures =( */ update_forced = forced; icon_list_forall(&embedder_update_window_position); return SUCCESS; } int embedder_refresh(struct TrayIcon *ti) { if (!ti->is_visible) return NO_MATCH; XClearWindow(tray_data.dpy, ti->mid_parent); x11_refresh_window(tray_data.dpy, ti->wid, ti->l.wnd_sz.x, ti->l.wnd_sz.y, True); /* Check if the icon has survived all these manipulations */ if (!x11_ok()) { LOG_TRACE(("could not refresh 0x%x\n", ti->wid)); ti->is_invalid = True; } return NO_MATCH; } /* This function defines initial icon size or * is used to reset size of the icon window */ int embedder_reset_size(struct TrayIcon *ti) { struct Point icon_sz = {0, 0}; int rc = FAILURE; /* Do not reset size for non-KDE icons with size set if icon_resizes * are handled */ if (ti->is_size_set && ti->cmode != CM_KDE && !settings.kludge_flags & KLUDGE_FORCE_ICONS_SIZE) return SUCCESS; /* Increase counter of size resets for given icon. If this number * exeeds the threshold, do nothing. This should work around the icons * that react badly to size changes */ if (ti->is_size_set) ti->num_size_resets++; if (ti->num_size_resets > ICON_SIZE_RESETS_THRESHOLD) return SUCCESS; if (ti->cmode == CM_KDE) { icon_sz.x = settings.icon_size < KDE_ICON_SIZE ? settings.icon_size : KDE_ICON_SIZE; icon_sz.y = icon_sz.x; } else { /* If icon hints are to be respected, retrive the data */ if (settings.kludge_flags & KLUDGE_USE_ICONS_HINTS) rc = x11_get_window_min_size(tray_data.dpy, ti->wid, &icon_sz.x, &icon_sz.y); /* If this has failed, or icon hinst are not respected, or minimal size hints * are too small, fall back to default values */ if (!rc || !(settings.kludge_flags & KLUDGE_USE_ICONS_HINTS) || (settings.kludge_flags & KLUDGE_FORCE_ICONS_SIZE) || (icon_sz.x < settings.icon_size && icon_sz.y < settings.icon_size)) { icon_sz.x = settings.icon_size; icon_sz.y = settings.icon_size; } } LOG_TRACE(("proposed icon size: %dx%d\n", icon_sz.x, icon_sz.y)); if (x11_set_window_size(tray_data.dpy, ti->wid, icon_sz.x, icon_sz.y)) { ti->l.wnd_sz = icon_sz; ti->is_size_set = True; return SUCCESS; } else { ti->is_invalid = True; return FAILURE; } } stalonetray-0.8.3/src/image.c0000644000175000017500000002004412461504712015156 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * image.c * Fri, 22 Jun 2007 23:32:27 +0700 * ------------------------------- * Simple XImage manipulation * interface * -------------------------------*/ #include "image.h" #include "debug.h" /***** Forward declarations *****/ /* Depth-specialized versions of tinting routine */ int image_tint_32(CARD8 *data, size_t len, CARD32 pixel, CARD8 alpha); int image_tint_24(CARD8 *data, size_t len, CARD32 pixel, CARD8 alpha); int image_tint_16(CARD16 *data, size_t len, CARD32 pixel, CARD8 alpha); int image_tint_15(CARD16 *data, size_t len, CARD32 pixel, CARD8 alpha); /* Depth-specialized versions of compose routine */ int image_compose_32(CARD8 *data, CARD8 *bg, CARD8 *mask, size_t len); int image_compose_24(CARD8 *data, CARD8 *bg, CARD8 *mask, size_t len); int image_compose_16(CARD16 *data, CARD16 *bg, CARD8 *mask, size_t len); int image_compose_15(CARD16 *data, CARD16 *bg, CARD8 *mask, size_t len); /***** Interface level *****/ int image_tint(XImage *image, XColor *color, CARD8 alpha) { switch (image->bits_per_pixel) { case 32: return image_tint_32((CARD8 *) image->data, image->width * image->height, color->pixel, alpha); case 24: return image_tint_24((CARD8 *) image->data, image->width * image->height, color->pixel, alpha); case 16: return image_tint_16((CARD16 *) image->data, image->width * image->height, color->pixel, alpha); case 15: return image_tint_15((CARD16 *) image->data, image->width * image->height, color->pixel, alpha); default: DIE_IE(("image_tint() called with unsupported depth %d\n", image->bits_per_pixel)); return FAILURE; } } int image_compose(XImage *image, XImage *bg, CARD8 *mask) { switch (image->bits_per_pixel) { case 32: return image_compose_32((CARD8 *) image->data, (CARD8 *) bg->data, mask, (image->width * image->height)); case 24: return image_compose_24((CARD8 *) image->data, (CARD8 *) bg->data, mask, (image->width * image->height)); case 16: return image_compose_16((CARD16 *) image->data, (CARD16 *) bg->data, mask, (image->width * image->height)); case 15: return image_compose_15((CARD16 *) image->data, (CARD16 *) bg->data, mask, (image->width * image->height)); default: DIE_IE(("image_compose() called with unsupported depth %d\n", image->bits_per_pixel)); return FAILURE; } } CARD8 *image_create_alpha_mask(int ord, int w, int h) { unsigned char *m, *ll, *ul; int x, y, bord; bord = (1 << ord) - 1; m = malloc(w * h); if (m == NULL) return NULL; memset(m, 255, w * h); /* Shade top and bootom of the rectangle */ ul = m; /* top */ ll = m + (w * (h - 1)); /* bottom */ for (y = 0; y < bord; y++) { for (x = 0; x < w; x++) { ul[x] = ((unsigned int) ul[x] * (y + 1)) >> ord; ll[x] = ((unsigned int) ll[x] * (y + 1)) >> ord; } ul += w; ll -= w; } /* Shade left and right of the rectangle */ for (x = 0; x < bord; x++) { ul = m + x; /* left side */ ll = m + w - x - 1; /* right side */ for (y = 0; y < h; y++) { *ul = ((unsigned int) *ul * (x + 1)) >> ord; *ll = ((unsigned int) *ll * (x + 1)) >> ord; ll += w; ul += w; } } return m; } /***** Implementation level *****/ #define sr16(p,a) (((CARD32)((p) & 0xf800) * (a))) #define sg16(p,a) (((CARD32)((p) & 0x7e0) * (a))) #define sb16(p,a) (((CARD32)((p) & 0x1f) * (a))) #define sr15(p,a) (((CARD32)((p) & 0x7c00) * (a))) #define sg15(p,a) (((CARD32)((p) & 0x3e0) * (a))) #define sb15(p,a) (((CARD32)((p) & 0x1f) * (a))) int image_tint_32(CARD8 *data, size_t len, CARD32 pixel, CARD8 alpha) { CARD8 *p, tr, tg, tb, ralpha; ralpha = 255 - alpha; #ifndef BIGENDIAN tr = ((pixel & 0x00ff0000) * alpha) >> 24; tg = ((pixel & 0x0000ff00) * alpha) >> 16; tb = ((pixel & 0x000000ff) * alpha) >> 8; #else tr = ((pixel & 0x000000ff) * alpha) >> 8; tg = ((pixel & 0x0000ff00) * alpha) >> 16; tb = ((pixel & 0x00ff0000) * alpha) >> 24; #endif /* traverse data by 4 bytes starting from the end */ for (p = data + (len - 1) * 4; p >= data; p -= 4) { #ifndef BIGENDIAN p[0] = (((CARD16) p[0] * ralpha) >> 8) + tb; p[1] = (((CARD16) p[1] * ralpha) >> 8) + tg; p[2] = (((CARD16) p[2] * ralpha) >> 8) + tr; #else p[0] = (((CARD16) p[0] * ralpha) >> 8) + tr; p[1] = (((CARD16) p[1] * ralpha) >> 8) + tg; p[2] = (((CARD16) p[2] * ralpha) >> 8) + tb; #endif } return SUCCESS; } int image_tint_24(CARD8 *data, size_t len, CARD32 pixel, CARD8 alpha) { CARD8 *p, tr, tg, tb, ralpha; ralpha = 255 - alpha; #ifndef BIGENDIAN tr = ((pixel & 0x00ff0000) * alpha) >> 24; tg = ((pixel & 0x0000ff00) * alpha) >> 16; tb = ((pixel & 0x000000ff) * alpha) >> 8; #else tr = ((pixel & 0x000000ff) * alpha) >> 8; tg = ((pixel & 0x0000ff00) * alpha) >> 16; tb = ((pixel & 0x00ff0000) * alpha) >> 24; #endif /* traverse data by 3 bytes starting from the end */ for (p = data + (len - 1) * 3; p >= data; p -= 3) { #ifndef BIGENDIAN p[0] = (((CARD16) p[0] * ralpha) >> 8) + tb; p[1] = (((CARD16) p[1] * ralpha) >> 8) + tg; p[2] = (((CARD16) p[2] * ralpha) >> 8) + tr; #else p[0] = (((CARD16) p[0] * ralpha) >> 8) + tr; p[1] = (((CARD16) p[1] * ralpha) >> 8) + tg; p[2] = (((CARD16) p[2] * ralpha) >> 8) + tb; #endif } return SUCCESS; } int image_tint_16(CARD16 *data, size_t len, CARD32 pixel, CARD8 alpha) { CARD32 tr, tg, tb; CARD32 r, g, b; CARD16 *p; CARD8 ralpha; ralpha = 255 - alpha; tr = sr16(pixel, alpha); tg = sg16(pixel, alpha); tb = sb16(pixel, alpha); /* traverse data by 2 bytes starting from the end */ for (p = data + len - 1; p >= data; p--) { r = sr16(*p, ralpha) + tr; g = sg16(*p, ralpha) + tg; b = sb16(*p, ralpha) + tg; *p = ((r >> 8) & 0xf800) | ((g >> 8) & 0x7e0) | ((b >> 8) & 0x1f); } return SUCCESS; } int image_tint_15(CARD16 *data, size_t len, CARD32 pixel, CARD8 alpha) { CARD32 tr, tg, tb; CARD32 r, g, b; CARD16 *p; CARD8 ralpha; ralpha = 255 - alpha; tr = sr15(pixel, alpha); tg = sg15(pixel, alpha); tb = sb15(pixel, alpha); /* traverse data by 2 bytes starting from the end */ for (p = data + len - 1; p >= data; p--) { r = sr15(*p, ralpha) + tr; g = sg15(*p, ralpha) + tg; b = sb15(*p, ralpha) + tg; *p = ((r >> 8) & 0x7c00) | ((g >> 8) & 0x3e0) | ((b >> 8) & 0x1f); } return SUCCESS; } int image_compose_32(CARD8 *data, CARD8 *bg, CARD8 *mask, size_t len) { CARD8 *p, *b, *m; CARD16 a, ra; /* traverse data, bg by 4 bytes and mask by 1 byte starting from the end */ for (p = data + (len - 1) * 4, b = bg + (len - 1) * 4, m = mask + len - 1; p != data - 4; p -= 4, b -= 4, m--) { a = *m; ra = 255 - a; p[0] = (p[0] * a + b[0] * ra) >> 8; p[1] = (p[1] * a + b[1] * ra) >> 8; p[2] = (p[2] * a + b[2] * ra) >> 8; } return SUCCESS; } int image_compose_24(CARD8 *data, CARD8 *bg, CARD8 *mask, size_t len) { CARD8 *p, *b, *m; CARD16 a, ra; /* traverse data, bg by 3 bytes and mask by 1 byte starting from the end */ for (p = data + (len - 1) * 3, b = bg + (len - 1) * 3, m = mask + len - 1; p != data - 3; p -= 3, b -= 3, m--) { a = *m; ra = 255 - a; p[0] = (p[0] * a + b[0] * ra) >> 8; p[1] = (p[1] * a + b[1] * ra) >> 8; p[2] = (p[2] * a + b[2] * ra) >> 8; } return SUCCESS; } int image_compose_16(CARD16 *data, CARD16 *bg, CARD8 *mask, size_t len) { CARD32 r, g, b; CARD16 *p, *pb; CARD8 a, ra, *m; /* traverse data by 2 bytes starting from the end */ for (p = data + len - 1, pb = bg + len - 1, m = mask + len - 1; p != data; p--, pb--, m--) { a = *m; ra = 255 - a; r = sr16(*p, a) + sr16(*pb, ra); g = sg16(*p, a) + sg16(*pb, ra); b = sb16(*p, a) + sb16(*pb, ra); *p = ((r >> 8) & 0xf800) | ((g >> 8) & 0x7e0) | ((b >> 8) & 0x1f); } return SUCCESS; } int image_compose_15(CARD16 *data, CARD16 *bg, CARD8 *mask, size_t len) { CARD32 r, g, b; CARD16 *p, *pb; CARD8 a, ra, *m; /* traverse data by 2 bytes starting from the end */ for (p = data + len - 1, pb = bg + len - 1, m = mask + len - 1; p != data; p--, pb--, m--) { a = *mask; ra = 255 - a; r = sr15(*p, a) + sr15(*pb, ra); g = sg15(*p, a) + sg15(*pb, ra); b = sb15(*p, a) + sb15(*pb, ra); *p = ((r >> 8) & 0x7c00) | ((g >> 8) & 0x3e0) | ((b >> 8) & 0x1f); } return SUCCESS; } stalonetray-0.8.3/src/icons.h0000644000175000017500000000747512461504712015231 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * icons.h * Tue, 24 Aug 2004 12:05:38 +0700 * ------------------------------- * Manipulations with the list of * tray icons * -------------------------------*/ #ifndef _ICONS_H_ #define _ICONS_H_ #include "config.h" #include #include /* Simple point & rect data structures */ struct Point { int x, y; }; struct Rect { int x, y, w, h; }; /* Tray icon layout data structure */ struct Layout { struct Rect grd_rect; /* The rect in the grid */ struct Rect icn_rect; /* Real position inside the tray */ struct Point wnd_sz; /* Size of the window of the icon */ }; /* Tray icon data structure */ struct TrayIcon { struct TrayIcon *next; struct TrayIcon *prev; Window wid; /* Window ID */ Window mid_parent; /* Mid-parent ID */ int cmode; /* Compatibility mode: CM_FDO/CM_KDE (see embed.h) */ int is_embedded; /* Flag: is the icon succesfully embedded ? */ int is_invalid; /* Flag: is the icon invalid ? */ int is_visible; /* Flag: is the icon hidden ? */ int is_resized; /* Flag: the icon has recently resized itself */ int is_layed_out; /* Flag: the icon is succesfully layed out */ int is_updated; /* Flag: the position of the icon needs to be updated */ int is_xembed_supported; /* Flag: does the icon support xembed */ unsigned long xembed_data[2];/* XEMBED data */ int num_size_resets; /* How many times size was reset */ int is_size_set; /* Flag: has the size for the icon been set */ int is_xembed_accepts_focus;/* Flag: does the icon want focus */ long xembed_last_timestamp; /* The timestamp of last processed xembed message */ long xembed_last_msgid; /* ID of the last processed xembed message */ struct Layout l; /* Layout info */ }; /* Typedef for comparison function */ typedef int (*IconCmpFunc) (struct TrayIcon *, struct TrayIcon *); /* Typedef for callback function */ typedef int (*IconCallbackFunc) (struct TrayIcon *); /* Add the new icon to the list */ struct TrayIcon *icon_list_new(Window w, int cmode); /* Delete the icon from the list */ int icon_list_free(struct TrayIcon *ti); /* Return the next/previous icon in the list after the icon specified by ti */ struct TrayIcon *icon_list_next(struct TrayIcon *ti); struct TrayIcon *icon_list_prev(struct TrayIcon *ti); /************************************************* * BIG FAT WARNING: backup/restore routines will * memleak/fail if the number of icons in the * list has changed between backup/restore calls. * (in return, it does not invalidate pointers :P) *************************************************/ /* Back up the list */ int icon_list_backup(); /* Restore the list from the backup */ int icon_list_restore(); /* Free the back-up list */ int icon_list_backup_purge(); /* Apply a callback specified by cbk to all icons. * List is traversed in a natural order. Function stops * and returns current_icon if cbk(current_icon) == MATCH */ struct TrayIcon *icon_list_forall(IconCallbackFunc cbk); /* For readability sake, we sometimes use this function */ #define icon_list_advanced_find icon_list_forall /* Same as above, but start traversal from the icon specified by tgt */ struct TrayIcon *icon_list_forall_from(struct TrayIcon *tgt, IconCallbackFunc cbk); /* Clear the whole list */ int icon_list_clean(); /* Clear the whole list, calling cbk for each icon */ int icon_list_clean_callback(IconCallbackFunc cbk); /* Sort the list using comparison function specified by cmp. * Memo for writing comparison functions: * if a < b => cmp(a,b) < 0 * if a = b => cmp(a,b) = 0 * if a > b => cmp(a,b) > 0 */ void icon_list_sort(IconCmpFunc cmp); /* Find the icon with wid == w */ struct TrayIcon *icon_list_find(Window w); /* Find the icon with wid == w or parent wid == w */ struct TrayIcon *icon_list_find_ex(Window w); #endif stalonetray-0.8.3/src/Makefile.in0000644000175000017500000004523212475441244016010 0ustar varunvarun# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = stalonetray$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/config.h.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_stalonetray_OBJECTS = main.$(OBJEXT) icons.$(OBJEXT) \ xembed.$(OBJEXT) layout.$(OBJEXT) embed.$(OBJEXT) \ settings.$(OBJEXT) xutils.$(OBJEXT) tray.$(OBJEXT) \ wmh.$(OBJEXT) debug.$(OBJEXT) image.$(OBJEXT) \ scrollbars.$(OBJEXT) stalonetray_OBJECTS = $(am_stalonetray_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(stalonetray_SOURCES) $(EXTRA_stalonetray_SOURCES) DIST_SOURCES = $(stalonetray_SOURCES) $(EXTRA_stalonetray_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ kde_tray_support = @kde_tray_support@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ stalonetray_SOURCES = main.c icons.c icons.h xembed.c xembed.h layout.c layout.h embed.c embed.h \ settings.c settings.h xutils.c xutils.h tray.c tray.h debug.h list.h \ wmh.c wmh.h common.h debug.c image.c image.h \ scrollbars.c scrollbars.h EXTRA_stalonetray_SOURCES = kde_tray.c kde_tray.h stalonetray_DEPENDENCIES = @kde_tray_support@ AM_CFLAGS = @X_CFLAGS@ stalonetray_LDADD = @kde_tray_support@ @X_LIBS@ @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) stalonetray$(EXEEXT): $(stalonetray_OBJECTS) $(stalonetray_DEPENDENCIES) $(EXTRA_stalonetray_DEPENDENCIES) @rm -f stalonetray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stalonetray_OBJECTS) $(stalonetray_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/embed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icons.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kde_tray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrollbars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wmh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xembed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xutils.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-hdr \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: stalonetray-0.8.3/src/xembed.c0000644000175000017500000004356512461504712015355 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * xembed.c * Tue, 24 Aug 2004 12:05:38 +0700 * ------------------------------- * XEMBED protocol implementation * -------------------------------*/ /* Currently broken: * - XEMBED_{ACTIVATE,REGISTER,UNREGISTER}_ACCELERATOR * - XEMBED_REQUEST_FOCUS */ #include #include #include #include #include "common.h" #include "debug.h" #include "xembed.h" #include "xutils.h" #include "wmh.h" #include "list.h" /* Internal return codes */ #define XEMBED_RESULT_OK 0 #define XEMBED_RESULT_UNSUPPORTED 1 #define XEMBED_RESULT_X11ERROR 2 /* XEMBED messages */ #define XEMBED_EMBEDDED_NOTIFY 0 #define XEMBED_WINDOW_ACTIVATE 1 #define XEMBED_WINDOW_DEACTIVATE 2 #define XEMBED_REQUEST_FOCUS 3 #define XEMBED_FOCUS_IN 4 #define XEMBED_FOCUS_OUT 5 #define XEMBED_FOCUS_NEXT 6 #define XEMBED_FOCUS_PREV 7 /* 8-9 were used for XEMBED_GRAB_KEY/XEMBED_UNGRAB_KEY */ #define XEMBED_MODALITY_ON 10 #define XEMBED_MODALITY_OFF 11 #define XEMBED_REGISTER_ACCELERATOR 12 #define XEMBED_UNREGISTER_ACCELERATOR 13 #define XEMBED_ACTIVATE_ACCELERATOR 14 /* Details for XEMBED_FOCUS_IN */ #define XEMBED_FOCUS_CURRENT 0 #define XEMBED_FOCUS_FIRST 1 #define XEMBED_FOCUS_LAST 2 /* Modifiers field for XEMBED_REGISTER_ACCELERATOR */ #define XEMBED_MODIFIER_SHIFT (1 << 0) #define XEMBED_MODIFIER_CONTROL (1 << 1) #define XEMBED_MODIFIER_ALT (1 << 2) #define XEMBED_MODIFIER_SUPER (1 << 3) #define XEMBED_MODIFIER_HYPER (1 << 4) /* Flags for XEMBED_ACTIVATE_ACCELERATOR */ #define XEMBED_ACCELERATOR_OVERLOADED (1 << 0) /* Directions for focusing */ #define XEMBED_DIRECTION_DEFAULT 0 #define XEMBED_DIRECTION_UP_DOWN 1 #define XEMBED_DIRECTION_LEFT_RIGHT 2 /* Flags for _XEMBED_INFO */ #define XEMBED_MAPPED (1 << 0) /* Structure to hold XEMBED accelerator data */ struct XEMBEDAccel { struct XEMBEDAccel *next, *prev; int overloaded; /* Is this accelerator overloaded? */ long id; /* Accelerator Id */ long symb; /* Symbol */ long mods; /* Modifiers */ }; /* Shortcuts for sending XEMBED messages */ #define xembed_send_msg(dpy, dst, timestamp, msg, detail, data1, data2) \ x11_send_client_msg32(dpy, dst, dst, tray_data.xembed_data.xa_xembed, timestamp, msg, detail, data1, data2) #define xembed_send_embedded_notify(dpy, src, dst, timestamp) \ xembed_send_msg(dpy, dst, timestamp, XEMBED_EMBEDDED_NOTIFY, 0, src, 0) #define xembed_send_window_activate(dpy, dst, timestamp) \ xembed_send_msg(dpy, dst, timestamp, XEMBED_WINDOW_ACTIVATE, 0, 0, 0) #define xembed_send_window_deactivate(dpy, dst, timestamp) \ xembed_send_msg(dpy, dst, timestamp, XEMBED_WINDOW_DEACTIVATE, 0, 0, 0) #define xembed_send_focus_in(dpy, dst, focus, timestamp) \ xembed_send_msg(dpy, dst, timestamp, XEMBED_FOCUS_IN, focus, 0, 0) #define xembed_send_focus_out(dpy, dst, timestamp) \ xembed_send_msg(dpy, dst, timestamp, XEMBED_FOCUS_OUT, 0, 0, 0) #define xembed_send_activate_accelerator(dpy, dst, timestamp, id, overloaded) \ xembed_send_msg(dpy, dst, timestamp, XEMBED_ACTIVATE_ACCELERATOR, id, overloaded, 0) /* Retrive XEMBED data for the given icon */ int xembed_retrive_data(struct TrayIcon *ti); /* Post icon XEMBED data to window property */ int xembed_post_data(struct TrayIcon *ti); /* Returns the next icon in tab chain */ struct TrayIcon *xembed_next(); /* Returns the previous icon in tab chain */ struct TrayIcon *xembed_prev(); /* XEMBED event handler */ int xembed_process_kbd_event(XKeyEvent xkey); /* Register new XEMBED accelerator */ void xembed_add_accel(long id, long symb, long mods); /* Delete previously registered XEMBED accelerator */ void xembed_del_accel(long id); /* Activate previously registered XEMBED accelerator */ void xembed_act_accel(struct XEMBEDAccel *accel); /* Switch XEMBED focus to the specified icon */ void xembed_switch_focus_to(struct TrayIcon *tgt, long focus); /* Broadcast the focus change to all icons */ void xembed_track_focus_change(int activate); /* Process XEMBED message */ void xembed_message(XClientMessageEvent ev); /* Tries to request focus from WM */ void xembed_request_focus_from_wm(); void xembed_init() { /* 1. Initialize data structures */ tray_data.xembed_data.window_has_focus = False; tray_data.xembed_data.focus_requested = False; tray_data.xembed_data.current = NULL; tray_data.xembed_data.accels = NULL; tray_data.xembed_data.timestamp = CurrentTime; tray_data.xembed_data.xa_xembed = XInternAtom(tray_data.dpy, "_XEMBED", False); tray_data.xembed_data.xa_xembed_info = XInternAtom(tray_data.dpy, "_XEMBED_INFO", False); /* 2. Create focus proxy (see XEMBED spec) */ tray_data.xembed_data.focus_proxy = XCreateSimpleWindow(tray_data.dpy, tray_data.tray, -1, -1, 1, 1, 0, 0, 0); XSelectInput(tray_data.dpy, tray_data.xembed_data.focus_proxy, FocusChangeMask | KeyPressMask | KeyReleaseMask); XMapRaised(tray_data.dpy, tray_data.xembed_data.focus_proxy); if (!x11_ok()) DIE(("could not create focus proxy\n")); LOG_TRACE(("created focus proxy, wid=0x%x\n", tray_data.xembed_data.focus_proxy)); } void xembed_handle_event(XEvent ev) { switch (ev.type) { case FocusOut: /* Broadcast that the focus has left tray window */ LOG_TRACE(("FocusOut 0x%x\n", ev.xfocus.window)); if (ev.xfocus.window == tray_data.xembed_data.focus_proxy) xembed_track_focus_change(False); break; case ClientMessage: /* Handle XEMBED-related messages */ if (ev.xclient.message_type == tray_data.xembed_data.xa_xembed) { xembed_message(ev.xclient); } else if (ev.xclient.message_type == tray_data.xa_tray_opcode) { /* we peek at _NET_SYSTEM_TRAY_OPCODE messages * to obtain proper timestamp for embedding */ tray_data.xembed_data.timestamp = ev.xclient.data.l[0]; if (tray_data.xembed_data.timestamp == CurrentTime) tray_data.xembed_data.timestamp = x11_get_server_timestamp(tray_data.dpy, tray_data.tray); } else if (ev.xclient.message_type == tray_data.xa_wm_protocols && ev.xclient.data.l[0] == tray_data.xa_wm_take_focus && tray_data.xembed_data.focus_requested) { XSetInputFocus(tray_data.dpy, tray_data.xembed_data.focus_proxy, RevertToParent, ev.xclient.data.l[1]); if (!x11_ok()) DIE_IE(("Could not set focus to XEMBED focus proxy\n")); LOG_TRACE(("focus set to focus proxy\n")); xembed_track_focus_change(True); tray_data.xembed_data.focus_requested = False; } break; case KeyRelease: case KeyPress: /* Propagate key events to currently focused icon */ tray_data.xembed_data.timestamp = ev.xkey.time; if (ev.type == KeyRelease && xembed_process_kbd_event(ev.xkey)) break; if (tray_data.xembed_data.current != NULL) { int rc; LOG_TRACE(("current icon accepts_focus: %d\n", tray_data.xembed_data.current->is_xembed_accepts_focus)); rc = XSendEvent(tray_data.dpy, tray_data.xembed_data.current->wid, False, NoEventMask, &ev); if (!x11_ok() || rc == 0) { tray_data.xembed_data.current->is_invalid = True; return; } LOG_TRACE(("sent key event to 0x%x\n", tray_data.xembed_data.current->wid)); } break; } } int xembed_check_support(struct TrayIcon *ti) { int rc = xembed_retrive_data(ti); ti->is_xembed_supported = (rc == XEMBED_RESULT_OK); return rc != XEMBED_RESULT_X11ERROR; } int xembed_get_mapped_state(struct TrayIcon *ti) { /* It is OK to retrive data each time this function * is called, since there is some overhead only during * initialization, when xembed_retrive_data is called 2 * times in a row(). */ int rc = xembed_retrive_data(ti); if (ti->is_xembed_supported && rc == XEMBED_RESULT_OK) return ((ti->xembed_data[1] & XEMBED_MAPPED) != 0); else { ti->is_xembed_supported = False; ti->is_invalid = (rc == XEMBED_RESULT_X11ERROR); return False; } } int xembed_set_mapped_state(struct TrayIcon *ti, int state) { if (!ti->is_xembed_supported) return FAILURE; if (state) ti->xembed_data[1] |= XEMBED_MAPPED; else ti->xembed_data[1] &= ~XEMBED_MAPPED; return xembed_post_data(ti); } int xembed_embed(struct TrayIcon *ti) { /* if XEMBED is not supported, do nothing */ if (!ti->is_xembed_supported) return SUCCESS; /* By default, consider that all icons accept focus */ ti->is_xembed_accepts_focus = True; /* Send notification */ if (!xembed_send_embedded_notify(tray_data.dpy, tray_data.tray, ti->wid, tray_data.xembed_data.timestamp)) return FAILURE; ti->xembed_last_timestamp = tray_data.xembed_data.timestamp; ti->xembed_last_msgid = XEMBED_EMBEDDED_NOTIFY; if (tray_data.xembed_data.current == NULL) { /* No icon has focus. Set focus to this one */ if (!xembed_send_focus_in(tray_data.dpy, ti->wid, XEMBED_FOCUS_FIRST, tray_data.xembed_data.timestamp)) return FAILURE; tray_data.xembed_data.current = ti; } /* Send activation message if tray window has focus */ if (tray_data.xembed_data.window_has_focus) return xembed_send_window_activate(tray_data.dpy, ti->wid, tray_data.xembed_data.timestamp); return SUCCESS; } int xembed_unembed(struct TrayIcon *ti) { struct TrayIcon *tmp; tray_data.xembed_data.timestamp = x11_get_server_timestamp(tray_data.dpy, tray_data.tray); if (ti == tray_data.xembed_data.current) { /* Currently focused icon is being unembedded, * move focus to the next icon. */ tmp = xembed_next(); if (tmp == ti || tmp->is_xembed_accepts_focus == False) { xembed_switch_focus_to(NULL, 0); } else { xembed_switch_focus_to(tmp, XEMBED_FOCUS_FIRST); } } return SUCCESS; } /*********** implementation level ***************/ void xembed_switch_focus_to(struct TrayIcon *tgt, long focus) { /* 1. Send "focus out" message to the currently focused icon */ if (tray_data.xembed_data.current != NULL) { LOG_TRACE(("XEMBED focus was removed from icon 0x%x (pointer %p)\n", tray_data.xembed_data.current->wid, tray_data.xembed_data.current)); xembed_send_focus_out(tray_data.dpy, tray_data.xembed_data.current->wid, tray_data.xembed_data.timestamp); } /* 2. Send "focus in" message to the icon to be focused */ if (tgt != NULL) { xembed_send_focus_in(tray_data.dpy, tgt->wid, focus, tray_data.xembed_data.timestamp); LOG_TRACE(("XEMBED focus was set to icon 0x%x (pointer %p)\n", tgt->wid, tgt)); } else { LOG_TRACE(("XEMBED focus was unset\n")); } tray_data.xembed_data.current = tgt; } static int activate = 0; int broadcast_activate_msg(struct TrayIcon *ti) { if (activate) xembed_send_window_activate(tray_data.dpy, ti->wid, tray_data.xembed_data.timestamp); else xembed_send_window_deactivate(tray_data.dpy, ti->wid, tray_data.xembed_data.timestamp); return NO_MATCH; } void xembed_track_focus_change(int in) { if (tray_data.xembed_data.window_has_focus == in) return; tray_data.xembed_data.window_has_focus = in; activate = in; icon_list_forall(&broadcast_activate_msg); LOG_TRACE(("XEMBED focus is %s\n", in ? "ON" : "OFF")); } void xembed_message(XClientMessageEvent ev) { long msgid; LOG_TRACE(("this is an _XEMBED message, window: 0x%x, timestamp: %u, opcode: %u, \ndetail: 0x%x, data1 = 0x%x, data2 = 0x%x\n", ev.window, ev.data.l[0], ev.data.l[1], ev.data.l[2], ev.data.l[3], ev.data.l[4])); #if DEBUG if (tray_data.xembed_data.current != NULL) LOG_TRACE(("XEMBED focus is in window 0x%x (pointer %p)\n", tray_data.xembed_data.current->wid, tray_data.xembed_data.current)); else LOG_TRACE(("XEMBED focus is unset\n")); #endif if (ev.window != tray_data.tray) { LOG_TRACE(("inoring _XEMBED message to some other window\n")); return; } /* Update timestamp if necessary */ if (ev.data.l[0] == CurrentTime) ev.data.l[0] = x11_get_server_timestamp(tray_data.dpy, tray_data.tray); tray_data.xembed_data.timestamp = ev.data.l[0]; msgid = ev.data.l[1]; LOG_TRACE(("_XEMBED message %u\n", msgid)); switch (msgid) { case XEMBED_REQUEST_FOCUS: xembed_request_focus_from_wm(); break; case XEMBED_FOCUS_NEXT: case XEMBED_FOCUS_PREV: if (tray_data.xembed_data.current != NULL) { struct TrayIcon *old_focus, *new_focus; old_focus = tray_data.xembed_data.current; new_focus = (msgid == XEMBED_FOCUS_NEXT) ? xembed_next(): xembed_prev(); if (new_focus->is_xembed_accepts_focus) { /* If the last message for the new focus target was focus_{next,prev} and * it has the same timestamp as the current message, it is likely that * the corresponding icon does not want to be focused at all. So mark it * as not accepting focus. */ if (new_focus->xembed_last_timestamp == tray_data.xembed_data.timestamp && (new_focus->xembed_last_msgid == XEMBED_FOCUS_NEXT || new_focus->xembed_last_msgid == XEMBED_FOCUS_PREV)) { new_focus->is_xembed_accepts_focus = False; new_focus = False; } old_focus->xembed_last_timestamp = tray_data.xembed_data.timestamp; old_focus->xembed_last_msgid = msgid; } else new_focus = NULL; xembed_switch_focus_to(new_focus, (msgid == XEMBED_FOCUS_NEXT) ? XEMBED_FOCUS_FIRST : XEMBED_FOCUS_LAST); } break; case XEMBED_REGISTER_ACCELERATOR: xembed_add_accel(ev.data.l[2], ev.data.l[3], ev.data.l[4]); break; case XEMBED_UNREGISTER_ACCELERATOR: xembed_del_accel(ev.data.l[2]); break; default: LOG_TRACE(("Unhandled _XEMBED message, id = %d\n", ev.data.l[1])); break; } } void xembed_add_accel(long id, long symb, long mods) { struct XEMBEDAccel *xaccel, *tmp; xaccel = (struct XEMBEDAccel *) malloc(sizeof(struct XEMBEDAccel)); if (xaccel == NULL) { LOG_ERR_OOM(("Could not register new XEMBED accelerator\n")); return; } xaccel->id = id; xaccel->symb = symb; xaccel->mods = mods; xaccel->overloaded = 0; /* Check if there are already registered accelerators that are overloaded * by this one */ for (tmp = tray_data.xembed_data.accels; tmp != NULL; tmp = tmp->next) if (tmp->symb == symb && tmp->mods == mods) { xaccel->overloaded++; tmp->overloaded++; } LIST_ADD_ITEM(tray_data.xembed_data.accels, xaccel); LOG_TRACE(("added new XEMBED accelerator: id=0x%x, sym=0x%x, mods=0x%x, overloaded=%d\n", id, symb, mods, xaccel->overloaded)); } void xembed_del_accel(long id) { struct XEMBEDAccel *tmp, *tgt = NULL; for (tmp = tray_data.xembed_data.accels; tmp != NULL; tmp = tmp->next) if (tmp->id == id) { tgt = tmp; return; } if (tgt == NULL) { LOG_TRACE(("refusing to remove unregistered XEMBED accelerator\n")); return; } /* Update overloaded status of the remaining accelerators */ for (tmp = tray_data.xembed_data.accels; tmp != NULL; tmp = tmp->next) if (tmp->symb == tgt->symb && tmp->mods == tgt->mods) tmp->overloaded--; LIST_DEL_ITEM(tray_data.xembed_data.accels, tgt); LOG_TRACE(("removed XEMBED accelator id=0x%x", tgt->id)); free(tgt); } static struct XEMBEDAccel *cur_accel; int xembed_act_accel_helper(struct TrayIcon *ti) { xembed_send_activate_accelerator(tray_data.dpy, ti->wid, tray_data.xembed_data.timestamp, cur_accel->id, cur_accel->overloaded ? 1 : 0); return NO_MATCH; } void xembed_act_accel(struct XEMBEDAccel *accel) { LOG_TRACE(("activating XEMBED accelerator: id=0x%x (symb=0x%x, mods=0x%x)\n", accel->id, accel->symb, accel->mods)); cur_accel = accel; icon_list_forall(&xembed_act_accel_helper); } int xembed_process_kbd_event(XKeyEvent xkey) { struct XEMBEDAccel *tmp; int hits = 0; KeySym keysym; static char buf[20]; XLookupString(&xkey, buf, 20, &keysym, NULL); LOG_TRACE(("Key event (type=%d) with keycode=0x%x, symb=0x%x, state=0x%x\n", xkey.type, xkey.keycode, keysym, xkey.state)); for (tmp = tray_data.xembed_data.accels; tmp != NULL; tmp = tmp->next) if (tmp->symb == keysym && tmp->mods == xkey.state) { xembed_act_accel(tmp); hits = 1; } return hits; } struct TrayIcon *xembed_next() { struct TrayIcon *tmp, *blocker; tmp = tray_data.xembed_data.current != NULL ? tray_data.xembed_data.current : NULL; blocker = tmp != NULL ? tmp : icon_list_next(NULL); do { tmp = layout_next(tmp); } while ((!tmp->is_xembed_supported || !tmp->is_xembed_accepts_focus) && tmp != blocker); return tmp; } struct TrayIcon *xembed_prev() { struct TrayIcon *tmp, *blocker; tmp = tray_data.xembed_data.current != NULL ? tray_data.xembed_data.current : NULL; blocker = tmp != NULL ? tmp : icon_list_prev(tmp); do { tmp = layout_prev(tmp); } while ((!tmp->is_xembed_supported || !tmp->is_xembed_accepts_focus) && tmp != blocker); return tmp; } int xembed_retrive_data(struct TrayIcon *ti) { Atom act_type; int act_fmt; unsigned long nitems, bytesafter, *data; unsigned char *tmpdata; int rc; /* NOTE: x11_get_win_prop32 is not used since we need to distinguish between * X11 errors and absence of the property */ rc = XGetWindowProperty(tray_data.dpy, ti->wid, tray_data.xembed_data.xa_xembed_info, 0, 2, False, tray_data.xembed_data.xa_xembed_info, &act_type, &act_fmt, &nitems, &bytesafter, &tmpdata); if (!x11_ok() || rc != Success) return XEMBED_RESULT_X11ERROR; rc = (act_type == tray_data.xembed_data.xa_xembed_info && nitems == 2); if (rc) { data = (unsigned long*) tmpdata; ti->xembed_data[0] = data[0]; ti->xembed_data[1] = data[1]; } if (nitems && tmpdata != NULL) XFree(tmpdata); return rc ? XEMBED_RESULT_OK : XEMBED_RESULT_UNSUPPORTED; } int xembed_post_data(struct TrayIcon *ti) { if (!ti->is_xembed_supported) return XEMBED_RESULT_UNSUPPORTED; XChangeProperty(tray_data.dpy, ti->wid, tray_data.xembed_data.xa_xembed_info, tray_data.xembed_data.xa_xembed_info, 32, PropModeReplace, (unsigned char *) ti->xembed_data, 2); return x11_ok() ? XEMBED_RESULT_OK : XEMBED_RESULT_X11ERROR; } void xembed_request_focus_from_wm() { if (!tray_data.is_reparented) { x11_send_client_msg32(tray_data.dpy, DefaultRootWindow(tray_data.dpy), tray_data.tray, XInternAtom(tray_data.dpy, "_NET_ACTIVE_WINDOW", True), 1, /* Request is from application */ x11_get_server_timestamp(tray_data.dpy, tray_data.tray), /* Timestamp */ 0, /* None window is focused current (?) */ 0, /* Unused */ 0);/* Unused */ tray_data.xembed_data.focus_requested = True; } } stalonetray-0.8.3/src/wmh.c0000644000175000017500000001650512461504712014676 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * ewmh.c * Thu, 30 Mar 2006 23:15:37 +0700 * ------------------------------- * EWMH/MWM support * ------------------------------- */ #include #include #include "wmh.h" #include "common.h" #include "debug.h" #include "xutils.h" /* Structure for Motif WM hints */ typedef struct { unsigned long flags; unsigned long functions; unsigned long decorations; long inputMode; unsigned long status; } PropMotifWmHints; /* Bit flags for fields of MWM hints data structure */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) /* Number of CARD32 entries in MWM hints data structure */ #define PROP_MOTIF_WM_HINTS_ELEMENTS 5 /* Check if WM that supports EWMH hints is present on given display */ int ewmh_wm_present(Display *dpy) { Window *check_win, *check_win_self_ref; unsigned long cw_len = 0, cwsr_len = 0; int rc = False; /* see _NET_SUPPORTING_WM_CHECK in the WM spec. */ rc = x11_get_root_winlist_prop(dpy, XInternAtom(dpy, _NET_SUPPORTING_WM_CHECK, False), (unsigned char **) &check_win, &cw_len); if (x11_ok() && rc && cw_len == 1) { LOG_TRACE(("_NET_SUPPORTING_WM_CHECK (root) = 0x%x\n", check_win[0])); x11_get_window_prop32(dpy, check_win[0], XInternAtom(dpy, _NET_SUPPORTING_WM_CHECK, False), XA_WINDOW, (unsigned char **) &check_win_self_ref, &cwsr_len); rc = (x11_ok() && rc && cwsr_len == 1 && check_win[0] == check_win_self_ref[0]); LOG_TRACE(("_NET_SUPPORTING_WM_CHECK (self reference) = 0x%x\n", check_win[0])); } if (cw_len != 0) XFree(check_win); if (cwsr_len != 0) XFree(check_win_self_ref); LOG_TRACE(("EWMH WM %sdetected\n", rc ? "" : "not ")); return rc; } /* Add EWMH window state for the given window */ int ewmh_add_window_state(Display *dpy, Window wnd, char *state) { Atom prop; Atom atom; XWindowAttributes xwa; int rc; prop = XInternAtom(dpy, "_NET_WM_STATE", False); atom = XInternAtom(dpy, state, False); LOG_TRACE(("adding state %s to window 0x%x\n", state, atom)); /* Ping the window and get its state */ rc = XGetWindowAttributes(dpy, wnd, &xwa); if (!x11_ok() || !rc ) return FAILURE; if (xwa.map_state != IsUnmapped && ewmh_wm_present(dpy)) { /* For mapped windows, ask WM (if it is here) to add the window state */ rc = x11_send_client_msg32(dpy, xwa.root, wnd, prop, _NET_WM_STATE_ADD, atom, 0, 0, 0); } else { /* Else, alter the window state atom value ourselves */ rc = XChangeProperty(dpy, wnd, prop, XA_ATOM, 32, PropModeAppend, (unsigned char *)&atom, 1); rc = x11_ok() && rc; } return rc; } /* Add EWMH window type for the given window */ int ewmh_add_window_type(Display *dpy, Window wnd, char *type) { Atom prop; Atom atom; prop = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); atom = XInternAtom(dpy, type, False); LOG_TRACE(("adding type %s to window 0x%x\n", type, atom)); /* Update property value (append) */ XChangeProperty(dpy, wnd, prop, XA_ATOM, 32, PropModeAppend, (unsigned char *)&atom, 1); return x11_ok(); } /* Set data for _NET_WM_STRUT{,_PARTIAL} hints */ int ewmh_set_window_strut(Display *dpy, Window wnd, wm_strut_t wm_strut) { Atom prop_strut; Atom prop_strut_partial; prop_strut = XInternAtom(dpy, _NET_WM_STRUT, False); prop_strut_partial = XInternAtom(dpy, _NET_WM_STRUT_PARTIAL, False); XChangeProperty(dpy, wnd, prop_strut, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)wm_strut, _NET_WM_STRUT_SZ); XChangeProperty(dpy, wnd, prop_strut_partial, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)wm_strut, _NET_WM_STRUT_PARTIAL_SZ); return x11_ok(); } /* Set CARD32 value of EWMH atom for a given window */ int ewmh_set_window_atom32(Display *dpy, Window wnd, char *prop_name, CARD32 value) { Atom prop; XWindowAttributes xwa; int rc; prop = XInternAtom(dpy, prop_name, False); LOG_TRACE(("0x%x: setting atom %s to 0x%x\n", wnd, prop_name, value)); /* Ping the window and get its state */ rc = XGetWindowAttributes(dpy, wnd, &xwa); if (!x11_ok() || !rc ) return FAILURE; if (xwa.map_state != IsUnmapped && ewmh_wm_present(dpy)) { /* For mapped windows, ask WM (if it is here) to add the window state */ return x11_send_client_msg32(dpy, DefaultRootWindow(dpy), wnd, prop, value, 2 /* source indication */, 0, 0, 0); } else { Atom atom = value; /* Else, alter the window state atom value ourselves */ XChangeProperty(dpy, wnd, prop, XA_ATOM, 32, PropModeAppend, (unsigned char *)&atom, 1); return x11_ok(); } } /* Set MWM hints */ int mwm_set_hints(Display *dpy, Window wnd, unsigned long decorations, unsigned long functions) { PropMotifWmHints *prop = NULL, new_prop; int act_fmt, rc; unsigned long nitems, bytes_after; static Atom atom = None, act_type; /* Check if WM supports Motif WM hints */ if (atom == None) atom = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); if (atom == None) return FAILURE; /* Get current hints */ rc = XGetWindowProperty(dpy, wnd, atom, 0, 5, False, atom, &act_type, &act_fmt, &nitems, &bytes_after, (unsigned char**) &prop); if ((act_type == None && act_fmt == 0 && bytes_after == 0) || nitems == 0) { /* Hints are either not set or have some other type. * Reset all values. */ memset(&new_prop, 0, sizeof(PropMotifWmHints)); if (prop != NULL) XFree(prop); prop = &new_prop; } else if (prop != NULL) { /* Copy value */ new_prop = *prop; XFree(prop); prop = &new_prop; } else { /* Something is broken */ x11_ok(); /* Reset x11 error status */ return FAILURE; } /* Update value */ prop->flags |= MWM_HINTS_DECORATIONS | MWM_HINTS_FUNCTIONS; prop->decorations = decorations; prop->functions = functions; XChangeProperty(dpy, wnd, atom, atom, 32, PropModeReplace, (unsigned char*) prop, PROP_MOTIF_WM_HINTS_ELEMENTS); return x11_ok(); } #ifdef DEBUG /* Dumps EWMH atoms supported by WM */ int ewmh_list_supported_atoms(Display *dpy) { Atom *atom_list; unsigned long atom_list_len, i; char *atom_name; if (ewmh_wm_present(dpy)) { if (x11_get_window_prop32(dpy, DefaultRootWindow(dpy), XInternAtom(dpy, _NET_SUPPORTED, False), XA_ATOM, (unsigned char **) &atom_list, &atom_list_len)) if (atom_list_len) { for (i = 0; i < atom_list_len; i++) { atom_name = XGetAtomName(dpy, atom_list[i]); if (atom_name != NULL) { LOG_TRACE(("_NET_SUPPORTED[%d]: %s (0x%x)\n", i, atom_name, atom_list[i])); } else LOG_TRACE(("_NET_SUPPORTED[%d]: bogus value (0x%x)\n", i, atom_list[i])); XFree(atom_name); x11_ok(); } free(atom_list); return SUCCESS; } } return FAILURE; } /* List EWMH states that are set for the given window */ int ewmh_dump_window_states(Display *dpy, Window wnd) { Atom prop, *data; unsigned long prop_len; int j; char *tmp; /* Check if WM supports _NET_WM_STATE */ prop = XInternAtom(tray_data.dpy, "_NET_WM_STATE", True); if (prop == None) return FAILURE; /* Retrive the list of states */ if (x11_get_window_prop32(dpy, wnd, prop, XA_ATOM, (unsigned char**) &data, &prop_len)) { for (j = 0; j < prop_len; j++) { tmp = XGetAtomName(tray_data.dpy, data[j]); if (x11_ok() && tmp != NULL) { LOG_TRACE(("0x%x:_NET_WM_STATE[%d] = %s\n", wnd, j, tmp)); XFree(tmp); } } return SUCCESS; } return FAILURE; } #endif stalonetray-0.8.3/src/settings.h0000644000175000017500000001000412461504712015734 0ustar varunvarun /* ------------------------------- * vim:tabstop=4:shiftwidth=4 * settings.h * Sun, 12 Sep 2004 18:06:08 +0700 * ------------------------------- * settings parser\container * -------------------------------*/ #ifndef _SETTINGS_H_ #define _SETTINGS_H_ #include #include #include "config.h" #include "layout.h" /* Default name of configuration file */ #define STALONETRAY_RC ".stalonetrayrc" struct Settings { /* Flags */ int parent_bg; /* Enable pseudo-transparency using parents' background*/ int deco_flags; /* Decoration flags */ int transparent; /* Enable root-transparency */ int skip_taskbar; /* Remove tray from wm`s taskbar */ int sticky; /* Make tray sticky across desktops/pages */ int xsync; /* Operate on X server syncronously */ int pixmap_bg; /* Is pixmap used for background */ int min_space_policy; /* Use placement that cause minimal grow */ int full_pmt_search; /* Use non-first-match search algorithm */ int vertical; /* Use vertical icon layout */ int shrink_back_mode; /* Keep tray's window size minimal */ int dockapp_mode; /* Activate dockapp mode */ int kludge_flags; /* What kludges to activate */ int need_help; /* Print usage and exit */ /* Strings */ char *display_str; /* Name of the display */ char *bg_color_str; /* Background color name */ char *scrollbars_highlight_color_str; /* Name of color to highlight scrollbars with. NULL means highlighting is disabled */ char *geometry_str; /* Geometry spec */ char *max_geometry_str; /* Geometry spec */ char *config_fname; /* Path to the configuration file */ char *wnd_type; /* Window type */ char *wnd_layer; /* Window layer */ char *wnd_name; /* Window name (WM_NAME) */ char *bg_pmap_path; /* Background pixmap path */ char *tint_color_str; /* Color used for tinting */ char *remote_click_name; /* Icon name to execute remote click on */ /* Values */ int icon_size; /* Icon size */ int slot_size; /* Grid slot size */ int grow_gravity; /* Icon gravity (interpretation of icon_gravity_str) */ int icon_gravity; /* Grow gravity (interpretation of grow_gravity_str) */ int win_gravity; /* Tray window gravity (computed using grow gravity) */ int bit_gravity; /* Tray window bit gravity (computed using icon_gravity) */ int geom_gravity; /* Tray window gravity when mapping the window (computed using geometry_str) */ int fuzzy_edges; /* Level of edges fuzziness (0 = disabled) */ int tint_level; /* Tinting level (0 = disabled) */ int scrollbars_mode; /* SB_MODE_NONE | SB_MODE_VERT | SB_MODE_HORZ */ int scrollbars_size; /* Size of scrollbar windows in pixels */ int scrollbars_inc; /* Step of scrollbar */ int wm_strut_mode; /* WM strut mode */ struct Point max_tray_dims;/* Maximal tray dimensions */ struct Point max_layout_dims; /* Maximal layout dimensions */ struct Point orig_tray_dims; /* Original tray dimensions */ struct Point remote_click_pos; /* Remote click position */ int remote_click_btn; /* Remote click button */ int remote_click_cnt; /* Remote click count */ XColor tint_color; /* Color used for tinting */ #ifdef DELAY_EMBEDDING_CONFIRMATION int confirmation_delay; #endif XColor bg_color; /* Tray background color */ XColor scrollbars_highlight_color; /* Color to highlight scrollbars with */ int log_level; /* Debug level */ }; extern struct Settings settings; /* Read settings from cmd line and configuration file */ int read_settings(int argc, char **argv); /* Interpret all settings that either need an * open display or are interpreted from other * settings */ void interpret_settings(); #endif stalonetray-0.8.3/src/debug.h0000644000175000017500000000442512461504712015174 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * debug.h * Tue, 24 Aug 2004 12:05:38 +0700 * ------------------------------- * Debugging code/utilities * -------------------------------*/ #ifndef _DEBUG_H_ #define _DEBUG_H_ #include #include #include "config.h" #include "settings.h" #include "tray.h" #include "common.h" #include #include #define LOG_LEVEL_ERR 0 #define LOG_LEVEL_INFO 1 #define LOG_LEVEL_TRACE 2 extern int debug_output_disabled; /* Disables all output from debugging macros */ void debug_disable_output(); /* Print the message to STDERR (in the sake of portability, we do not use varadic macros) */ void print_message_to_stderr(const char *fmt,...); #ifdef DEBUG /* The following defines control what is printed in each logged line */ /* Print window name */ #define TRACE_WM_NAME /* Print pid */ #undef TRACE_PID /* Print name of display */ #undef TRACE_DPY /* Print timestamp */ #define TRACE_TIMESTAMP /* Print name of a function, file and line which outputs the message */ /* Othewise, only function name is printed */ #undef TRACE_VERBOSE_LOCATION /* Print the debug header as specified by defines below */ void print_trace_header(const char *funcname, const char *fname, const int line); #define PRINT_TRACE_HEADER() do { \ print_trace_header(__FUNC__, __FILE__, __LINE__); \ } while(0) /* Print the debug message of specified level */ #define LOG_TRACE(message) do { \ if (!debug_output_disabled && settings.log_level >= LOG_LEVEL_TRACE) { \ PRINT_TRACE_HEADER(); \ print_message_to_stderr message; \ }; \ } while (0) #else #define PRINT_TRACE_HEADER() do {} while(0) #define LOG_TRACE(message) do {} while(0) #endif #define LOG_ERROR(message) do { \ if (!debug_output_disabled) { \ if (settings.log_level >= LOG_LEVEL_TRACE) PRINT_TRACE_HEADER(); \ if (settings.log_level >= LOG_LEVEL_ERR) print_message_to_stderr message; \ } \ } while(0) #define LOG_INFO(message) do { \ if (!debug_output_disabled) { \ if (settings.log_level >= LOG_LEVEL_TRACE) PRINT_TRACE_HEADER(); \ if (settings.log_level >= LOG_LEVEL_INFO) print_message_to_stderr message; \ } \ } while(0) /* Print the summary of icon data */ int print_icon_data(struct TrayIcon *ti); /* Print icon list contents */ void dump_icon_list(); #endif stalonetray-0.8.3/src/wmh.h0000644000175000017500000001010012461504712014664 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * ewmh.h * Thu, 30 Mar 2006 23:12:43 +0700 * ------------------------------- * EWMH/MWM support * ------------------------------- */ #ifndef _EWMH_H_ #define _EWMH_H_ #include "config.h" #include #include /* Defines for Motif WM functions */ #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) /* Defines for Motif WM decorations */ #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) /* EWMH atoms */ #define _NET_SUPPORTED "_NET_SUPPORTED" #define _NET_SUPPORTING_WM_CHECK "_NET_SUPPORTING_WM_CHECK" #define _NET_WM_DESKTOP "_NET_WM_DESKTOP" #define _NET_ACTIVE_WINDOW "_NET_ACTIVE_WINDOW" #define _NET_CLIENT_LIST "_NET_CLIENT_LIST" #define _NET_WM_PING "_NET_WM_PING" #define _NET_WM_STRUT_PARTIAL "_NET_WM_STRUT_PARTIAL" #define _NET_WM_STRUT "_NET_WM_STRUT" /* Defines for EWMH window types */ #define _NET_WM_WINDOW_TYPE_DESKTOP "_NET_WM_WINDOW_TYPE_DESKTOP" #define _NET_WM_WINDOW_TYPE_DOCK "_NET_WM_WINDOW_TYPE_DOCK" #define _NET_WM_WINDOW_TYPE_TOOLBAR "_NET_WM_WINDOW_TYPE_TOOLBAR" #define _NET_WM_WINDOW_TYPE_MENU "_NET_WM_WINDOW_TYPE_MENU" #define _NET_WM_WINDOW_TYPE_UTILITY "_NET_WM_WINDOW_TYPE_UTILITY" #define _NET_WM_WINDOW_TYPE_SPLASH "_NET_WM_WINDOW_TYPE_SPLASH" #define _NET_WM_WINDOW_TYPE_DIALOG "_NET_WM_WINDOW_TYPE_DIALOG" #define _NET_WM_WINDOW_TYPE_NORMAL "_NET_WM_WINDOW_TYPE_NORMAL" /* Defined for EWMH window states */ #define _NET_WM_STATE_MODAL "_NET_WM_STATE_MODAL" #define _NET_WM_STATE_STICKY "_NET_WM_STATE_STICKY" #define _NET_WM_STATE_MAXIMIZED_VERT "_NET_WM_STATE_MAXIMIZED_VERT" #define _NET_WM_STATE_MAXIMIZED_HORZ "_NET_WM_STATE_MAXIMIZED_HORZ" #define _NET_WM_STATE_SHADED "_NET_WM_STATE_SHADED" #define _NET_WM_STATE_SKIP_TASKBAR "_NET_WM_STATE_SKIP_TASKBAR" #define _NET_WM_STATE_SKIP_PAGER "_NET_WM_STATE_SKIP_PAGER" #define _NET_WM_STATE_HIDDEN "_NET_WM_STATE_HIDDEN" #define _NET_WM_STATE_FULLSCREEN "_NET_WM_STATE_FULLSCREEN" #define _NET_WM_STATE_ABOVE "_NET_WM_STATE_ABOVE" #define _NET_WM_STATE_BELOW "_NET_WM_STATE_BELOW" #define _NET_WM_STATE_DEMANDS_ATTENTION "_NET_WM_STATE_DEMANDS_ATTENTION" /* Flags for window state manipulations */ #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ #define _NET_WM_STATE_ADD 1 /* add/set property */ #define _NET_WM_STATE_TOGGLE 2 /* toggle property */ #define _NET_WM_STRUT_PARTIAL_SZ 12 #define _NET_WM_STRUT_SZ 4 typedef unsigned long wm_strut_t[_NET_WM_STRUT_PARTIAL_SZ]; #define WM_STRUT_IDX_LFT 0 #define WM_STRUT_IDX_RHT 1 #define WM_STRUT_IDX_TOP 2 #define WM_STRUT_IDX_BOT 3 #define WM_STRUT_IDX_START(B) B * 2 + 4 #define WM_STRUT_IDX_END(B) B * 2 + 5 /* Check if WM that supports EWMH hints is present on given display */ int ewmh_wm_present(Display *dpy); /* Add window type for the window wnd */ int ewmh_add_window_state(Display *dpy, Window wnd, char *state); /* Add window type for the window wnd */ int ewmh_add_window_type(Display *dpy, Window wnd, char *type); /* Set data for _NET_WM_STRUT_PARTIAL hint */ int ewmh_set_window_strut(Display *dpy, Window wnd, wm_strut_t wm_strut); /* Set CARD32 value of EWMH atom for a given window */ int ewmh_set_window_atom32(Display *dpy, Window wnd, char *prop_name, CARD32 value); /* Set Motif WM hints for window wnd; read MWM spec for more info */ int mwm_set_hints(Display *dpy, Window wnd, unsigned long decorations, unsigned long functions); #ifdef DEBUG /* Dumps EWMH atoms supported by WM */ int ewmh_list_supported_atoms(Display *dpy); /* Dump all EWMH states that have been set for the window wnd */ int ewmh_dump_window_states(Display *dpy, Window wnd); #endif #endif stalonetray-0.8.3/src/tray.h0000644000175000017500000001145112461504712015062 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * tray.h * Wed, 29 Sep 2004 23:10:02 +0700 * ------------------------------- * Common tray routines * -------------------------------*/ #ifndef _TRAY_H_ #define _TRAY_H_ #include #include #include #include #include "config.h" #include "common.h" #include "icons.h" #include "scrollbars.h" #include "xembed.h" /* Tray opcode messages from System Tray Protocol Specification * http:freedesktop.org/Standards/systemtray-spec/systemtray-spec-0.2.html */ #define SYSTEM_TRAY_REQUEST_DOCK 0 /* These two are unused */ #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 /* Custom message: remote control */ #define STALONE_TRAY_REMOTE_CONTROL 0xFFFD /* Custom message: request for status */ #define STALONE_TRAY_STATUS_REQUESTED 0xFFFE /* Custom message: confirmation of embedding */ #define STALONE_TRAY_DOCK_CONFIRMED 0xFFFF /* Name of tray selection atom */ #define TRAY_SEL_ATOM "_NET_SYSTEM_TRAY_S" /* Name of tray orientation atom*/ #define TRAY_ORIENTATION_ATOM "_NET_SYSTEM_TRAY_ORIENTATION" /* Name of tray orientation atom*/ #define STALONETRAY_REMOTE_ATOM "STALONETRAY_REMOTE" /* Values of tray orientation property */ #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0 #define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1 /* Window decoration flags */ #define DECO_BORDER (1 << 0) #define DECO_TITLE (1 << 1) #define DECO_NONE 0 #define DECO_ALL (DECO_BORDER | DECO_TITLE) /* WM struts flags */ #define WM_STRUT_NONE 0 #define WM_STRUT_LFT 1 #define WM_STRUT_RHT 2 #define WM_STRUT_TOP 3 #define WM_STRUT_BOT 4 #define WM_STRUT_AUTO 5 /* Dockapp modes */ #define DOCKAPP_NONE 0 #define DOCKAPP_SIMPLE 1 #define DOCKAPP_WMAKER 2 /* Kludge flags */ #define KLUDGE_FIX_WND_SIZE (1L << 1) #define KLUDGE_FIX_WND_POS (1L << 2) #define KLUDGE_USE_ICONS_HINTS (1L << 3) #define KLUDGE_FORCE_ICONS_SIZE (1L << 4) /* Remote click constants */ #define REMOTE_CLICK_BTN_DEFAULT Button1 #define REMOTE_CLICK_POS_DEFAULT INT_MAX #define REMOTE_CLICK_CNT_DEFAULT 1 /* Structure to hold all tray data */ struct TrayData { /* General */ Window tray; /* ID of tray window */ Window hint_win; /* ID of icon window */ Display *dpy; /* Display pointer */ XSizeHints xsh; /* Size & position of the tray window */ XSizeHints root_wnd; /* Size & position :) of the root window */ Window old_selection_owner; /* Old owner of tray selection */ int terminated; /* Exit flag */ int is_active; /* Is the tray active? */ int is_reparented; /* Was the tray reparented in smth like FvwmButtons ? */ int kde_tray_old_mode; /* Use legacy scheme to handle KDE icons via MapNotify */ /* Atoms */ Atom xa_tray_selection; /* Atom: _NET_SYSTEM_TRAY_SELECTION_S */ Atom xa_tray_opcode; /* Atom: _NET_SYSTEM_TRAY_MESSAGE_OPCODE */ Atom xa_tray_data; /* Atom: _NET_SYSTEM_TRAY_MESSAGE_DATA */ Atom xa_wm_protocols; /* Atom: WM_PROTOCOLS */ Atom xa_wm_delete_window; /* Atom: WM_DELETE_WINDOW */ Atom xa_net_wm_ping; /* Atom: WM_PING */ Atom xa_wm_take_focus; /* Atom: WM_TAKE_FOCUS */ Atom xa_kde_net_system_tray_windows; /* Atom: _KDE_NET_SYSTEM_TRAY_WINDOWS */ Atom xa_net_client_list; /* Atom: _NET_CLIENT_LIST */ /* Background pixmap */ Atom xa_xrootpmap_id; /* Atom: _XROOTPMAP_ID */ Atom xa_xsetroot_id; /* Atom: _XSETROOT_ID */ Pixmap bg_pmap; /* Pixmap for tray background */ struct Point bg_pmap_dims; /* Background pixmap dimensions */ /* XEMBED data */ struct XEMBEDData xembed_data; /* XEMBED data */ /* Scrollbar data */ struct ScrollbarsData scrollbars_data; }; extern struct TrayData tray_data; /* Initialize all tray data structures */ void tray_init(); /* Create tray window */ void tray_create_window(int argc, char **argv); /* Create phony tray window so that certain x11_ calls work */ void tray_create_phony_window(); /* Initialize tray selection atoms */ void tray_init_selection_atoms(); /* Acquire tray selection */ void tray_acquire_selection(); /* Show tray window */ void tray_show_window(); /* Refresh tray window */ void tray_refresh_window(int exposures); /* Update tray background (and pixmap, if update_pixmap is true) */ int tray_update_bg(int update_pixmap); /* Calculate tray window size given the size of icon area in pixels. */ int tray_calc_window_size(int base_width, int base_height, int *new_width, int *new_height); /* Calculate size of icon area given the tray window size in pixels. */ int tray_calc_tray_area_size(int wnd_width, int wnd_height, int *base_width, int *base_height); /* Update window struts (if enabled) */ int tray_update_window_strut(); /* Update tray window size and hints */ int tray_update_window_props(); /* Set tray window WM hints */ int tray_set_wm_hints(); #endif stalonetray-0.8.3/src/list.h0000644000175000017500000000542312461504712015060 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * list.h * Fri, 10 Sep 2004 23:34:48 +0700 * ------------------------------- * Simple double linked list * -------------------------------*/ #ifndef _LIST_H_ #define _LIST_H_ /* Implement basic functions for doubly-linked list. * Each structure to hold an element of the list must have two * fields pointer fields: prev and next. */ /* Add item i_ to the head of the list h_ (pointer to the head) */ #define LIST_ADD_ITEM(h_, i_) do { \ (i_)->prev = NULL; \ if ((h_) != NULL) { \ (i_)->next = (h_); \ (h_)->prev = (i_); \ } else { \ (i_)->next = NULL; \ } \ (h_) = (i_); \ } while(0) /* Insert item i_ after item t_ to the list h_ (pointer to the head) */ #define LIST_INSERT_AFTER(h_,t_,i_) do { \ (i_)->prev = (t_); \ if ((t_) != NULL) { \ (i_)->next = (t_)->next; \ (t_)->next = (i_); \ } else { \ if ((h_) != NULL) { \ (i_)->next = (h_); \ (h_)->prev = (i_); \ } else { \ (i_)->next = NULL; \ } \ (h_) = (i_); \ } \ } while(0) /* Delete item i_ from the list h_ (pointer to the head) */ #define LIST_DEL_ITEM(h_, i_) do { \ if (i_->prev != NULL) \ i_->prev->next = i_->next; \ if (i_->next != NULL) \ i_->next->prev = i_->prev; \ if (i_ == h_) \ h_ = i_->next; \ } while(0) /* Clean the list h_ (pointer to the head); * tmp_ is a temporary variable */ #define LIST_CLEAN(h_, tmp_) do { \ for (tmp_ = h_, h_ = (h_ != NULL) ? h_->next : NULL; tmp_ != NULL; \ tmp_ = h_, h_ = h_ != NULL ? h_->next : NULL) { \ free(tmp_); \ } \ h_ = NULL; \ } while(0) /* Clean the list h_ (pointer to the head) calling cbk_ for every * element of the list; tmp_ is a temporary variable */ #define LIST_CLEAN_CBK(h_, tmp_, cbk_) do { \ for (tmp_ = h_, h_ = (h_ != NULL) ? h_->next : NULL; tmp_ != NULL; \ tmp_ = h_, h_ = h_ != NULL ? h_->next : NULL) { \ cbk_(tmp_); \ free(tmp_); \ } \ h_ = NULL; \ } while(0) #endif stalonetray-0.8.3/src/common.h0000644000175000017500000000455611257443515015410 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * common.h * Mon, 01 May 2006 01:45:08 +0700 * ------------------------------- * Common declarations * -------------------------------*/ #ifndef _COMMON_H_ #define _COMMON_H_ #include "debug.h" #define PROGNAME PACKAGE /* Default icon size */ #define FALLBACK_ICON_SIZE 24 /* Minimal icon size */ #define MIN_ICON_SIZE 16 /* Default KDE icon size */ #define KDE_ICON_SIZE 22 /* Number of time icon is allowed to change its size after which * stalonetray gives up */ #define ICON_SIZE_RESETS_THRESHOLD 2 /* Meaningful names for return values */ #define SUCCESS 1 #define FAILURE 0 /* Simple macro to return status and log it if necessary */ #define RETURN_STATUS(rc) do { \ LOG_TRACE(("status = %s\n", ((rc) == SUCCESS ? "SUCCESS" : "FAILURE"))); \ return rc; \ } while(0) /* Meaningful names for return values of icon mass-operations */ #define MATCH 1 #define NO_MATCH 0 /* Simple macro to return mass-op status and log it if necessary */ #define RETURN_MATCH(rc) do { \ LOG_TRACE(("status = %s\n", rc == MATCH : "MATCH" : "NO_MATCH")); \ return rc; \ } while(0) /* Meaningful names for return values of icon mass-operations */ #define MATCH 1 /* Portable macro for function name */ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __FUNC__ __func__ #elif defined(__GNUC__) && __GNUC__ >= 3 #define __FUNC__ __FUNCTION__ #else #define __FUNC__ "unknown" #endif /* DIE */ #define DIEDIE() exit(-1) /* Print a message and... DIE */ #define DIE(message) do { LOG_ERROR(message); DIEDIE(); } while(0) /* Log OOM condition */ #define LOG_ERR_IE(message) do { \ LOG_ERROR(("Internal error, please report to maintaner (see AUTHORS)\n")); \ LOG_ERROR(message); \ } while(0); /* DIE on internal error */ #define DIE_IE(message) do { LOG_ERR_IE(message); DIEDIE(); } while(0) /* Log OOM condition */ #define LOG_ERR_OOM(message) do { \ LOG_ERROR(("Out of memory\n")); \ LOG_ERROR(message); \ } while(0); /* DIE on OOM error */ #define DIE_OOM(message) do { LOG_ERR_OOM(message); DIEDIE(); } while(0) /*** WARNING: feed following macros only with side-effects-free expressions ***/ /* Get a value within target interval */ #define cutoff(tgt,min,max) (tgt) < (min) ? (min) : ((tgt) > (max) ? max : tgt) /* Update value to fit into target interval */ #define val_range(tgt,min,max) (tgt) = cutoff(tgt,min,max) #endif stalonetray-0.8.3/src/embed.h0000644000175000017500000000175012461504712015160 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * embed.h * Fri, 03 Sep 2004 20:38:55 +0700 * ------------------------------- * embedding cycle implementation * -------------------------------*/ #ifndef _EMBED_H_ #include "icons.h" /* Constants for compatibility modes */ /* KDE */ #define CM_KDE 1 /* Generic, freedesktop.org */ #define CM_FDO 2 /* Embed an icon */ int embedder_embed(struct TrayIcon *ti); /* Unembed an icon */ int embedder_unembed(struct TrayIcon *ti); /* If (forced) * recalculate and update positions of all icons; * else * recalculate and update positions of all icons that have requested an update; */ int embedder_update_positions(int force); /* Show the icon */ int embedder_show(struct TrayIcon *ti); /* Hide the icon */ int embedder_hide(struct TrayIcon *ti); /* Refresh icon and its parent */ int embedder_refresh(struct TrayIcon *ti); /* (Re)set icon size according to the policy */ int embedder_reset_size(struct TrayIcon *ti); #endif stalonetray-0.8.3/src/kde_tray.h0000644000175000017500000000173411033443474015711 0ustar varunvarun/* ------------------------------- * vim:tabstop=4:shiftwidth=4 * kde_tray.h * Sun, 19 Sep 2004 12:28:59 +0700 * ------------------------------- * KDE tray related routines * -------------------------------*/ #ifndef _KDE_TRAY_H_ #define _KDE_TRAY_H_ /* Init support for KDE tray icons. */ void kde_tray_init(Display *dpy); /* Check if WM supports KDE tray icons */ int kde_tray_update_fallback_mode(Display *dpy); /* Update the list of "old" KDE icons. Icon is considered "old" * if it was present before the tray was started. */ int kde_tray_update_old_icons(Display *dpy); /* Check if the window w is an "old" KDE tray icon */ int kde_tray_is_old_icon(Window w); /* Remove the window w from the list of "old" KDE tray icons */ void kde_tray_old_icons_remove(Window w); /* Check if the window w is a KDE tray icon */ int kde_tray_check_for_icon(Display *dpy, Window w); /* Find KDE tray icon in subwindows of w */ Window kde_tray_find_icon(Display *dpy, Window w); #endif stalonetray-0.8.3/install-sh0000755000175000017500000003325512404035727015157 0ustar varunvarun#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: stalonetray-0.8.3/stalonetray.10000644000175000017500000003070412475441265015604 0ustar varunvarun'\" t .\" Title: stalonetray .\" Author: Roman Dubtsov .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/04/2015 .\" Manual: User Commands .\" Source: stalonetray 0.8 .\" Language: English .\" .TH "STALONETRAY" "1" "03/04/2015" "stalonetray 0\&.8" "User Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" stalonetray \- \fIsta\fRnd\-\fIalone\fR system tray (notification area) implementation\&. This document covers 0\&.8 version of stalonetray\&. .SH "SYNOPSIS" .HP \w'\fBstalonetray\fR\ 'u \fBstalonetray\fR [\fIoption\fR...] .SH "DESCRIPTION" .PP Stalonetray is a stand\-alone system tray (notification area) for X Window System/X11 (e\&.g\&. XOrg or XFree86)\&. It has minimal build and run\-time dependencies: an X11 lib only\&. Complete XEMBED support is under development\&. Stalonetray works with virtually any EWMH\-compliant window manager\&. .PP The behaviour and the look of stalonetray can be configured either via command line options or via configuration file\&. As usual, command\-line options have precedence over options that are specified in the configuration file\&. .PP Names of command line parameter may have two variants: short (\fB\-o\fR) and long (\fB\-\-option\fR)\&. Write \fB\-o\fR\fIvalue\fR or \fB\-o\fR\fIvalue\fR to pass a value using the short name of a parameter; to pass a value using a long name, write \fB\-\-option\fR\fIvalue\fR or \fB\-\-option\fR=\fIvalue\fR\&. All flag\-like parameters have optional boolean value that when ommited is assumed to be "true"\&. Write "true", "yes", "1", for positive boolean values, and "false", "no", "0" for negative ones\&. .PP Default configuration file is $HOME/\&.stalonetrayrc\&. A configuration file contains case\-insensetive keyword\-argument pairs, one per line\&. Lines starting with \*(Aq#\*(Aq and empty lines are ignored\&. Alternatively, confiuration file can specified via \fB\-c\fR or \fB\-\-config\fR command\-line options\&. .PP Below is the list of possible command line/configuration file options\&. Options starting with hyphens are command\-line parameters others are configuration file keywords\&. Options that are new in 0\&.8 version are marked with "NEW in 0\&.8"\&. .SH "OPTIONS" .PP \fB\-bg\fR \fIcolor\fR, \fB\-\-background\fR \fIcolor\fR, \fBbackground\fR \fIcolor\fR .RS 4 Use \fIcolor\fR for tray`s background\&. \fIcolor\fR can be specified as an HTML hex triplet or as a name from rgb\&.txt (note that \*(Aq#\*(Aq must be quoted)\&. Default value: \fB#777777\fR\&. .RE .PP \fB\-c\fR \fIfilename\fR, \fB\-\-config\fR \fIfilename\fR .RS 4 Read configuration from \fIfilename\fR instead of default $HOME/\&.stalonetrayrc\&. .RE .PP \fB\-d\fR \fIdecspec\fR, \fB\-\-decorations\fR \fIdecspec\fR, \fBdecorations\fR \fIdecspec\fR .RS 4 Specify visiblie tray window decorations\&. Possible values for \fIdecspec\fR are: \fBall\fR, \fBtitle\fR, \fBborder\fR, \fBnone\fR (default)\&. .RE .PP \fB\-display\fR \fIdisplay\fR, \fBdisplay\fR \fIdisplay\fR .RS 4 Use X display \fIdisplay\fR\&. .RE .PP \fB\-\-dockapp\-mode\fR [\fImode\fR], \fBdockapp_mode\fR [\fImode\fR] .RS 4 Set dockapp mode, which can be either \fBsimple\fR for e\&.g\&. OpenBox, \fBwmaker\fR for WindowMaker, or \fBnone\fR (default)\&. .RE .PP \fB\-f\fR [\fIlevel\fR], \fB\-\-fuzzy\-edges\fR [\fIlevel\fR], \fBfuzzy_edges\fR [\fIlevel\fR] .RS 4 Enable fuzzy edges of tray window and set fuzziness level which can range from \fB0\fR (disabled, default) to \fB3\fR\&. When ommited, the value of \fIlevel\fR defaults to 2\&. .RE .PP \fB\-\-geometry\fR \fIgeometry_spec\fR, \fBgeometry\fR \fIgeometry_spec\fR .RS 4 Set tray`s initial geometry to \fIgeometry_spec\fR, specified in standard X notation: \fIwidth\fRx\fIheight\fR[+\fIx\fR[+\fIy\fR]], where width and height are specified in icon slot multiples\&. Default value: \fB1x1+0\-0\fR\&. .RE .PP \fB\-\-grow\-gravity\fR \fIgravity\fR, \fBgrow_gravity\fR \fIgravity\fR .RS 4 Specify icon positioning gravity (eigher \fBN\fR, \fBS\fR, \fBW\fR, \fBE\fR, \fBNW\fR, \fBNE\fR, \fBSW\fR, \fBSE\fR)\&. Grow gravity specifies directions in which the tray\*(Aqs window may grow\&. For instance, if you specify \fBNW\fR the tray\*(Aqs window will grow down vertically and to the right horizontally (these are sides that are opposite to upper\-left or North\-West corner of the window); with \fBW\fR the tray\*(Aqs window will grow horizontally to the left side only, and it will vertically grow both upwards and downwards maintaining position of its center\&. Please note that the latter behaviour is new in 0\&.8\&. Default value: \fBNW\fR\&. .RE .PP \fB\-\-icon\-gravity\fR \fIgravity\fR, \fBicon_gravity\fR \fIgravity\fR .RS 4 Specify icon positioning gravity (either \fBNW\fR, \fBNE\fR, \fBSW\fR, \fBSE\fR)\&. If you specify, e\&.g \fBSW\fR, then icons will appear starting from the lower\-left corner of the tray\*(Aqs window\&. Default value: \fBNW\fR\&. .RE .PP \fB\-i\fR \fIn\fR, \fB\-\-icon\-size\fR \fIn\fR, \fBicon_size\fR \fIn\fR .RS 4 Set default icon size to \fIn\fR\&. Default value: \fB24\fR\&. Minimum: \fB16\fR\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Show help message\&. .RE .PP \fB\-\-log\-level\fR \fIlevel\fR, \fBlog_level\fR \fIlevel\fR .RS 4 Set the amount of info to be output by stalonetray\&. Possible values for \fIlevel\fR: \fBerr\fR (default), \fBinfo\fR, and \fBtrace\fR\&. For the \fBtrace\fR option to be available, stalonetray must be configured with \fB\-\-enable\-debug\fR at build\-time\&. .RE .PP \fB\-\-kludges\fR \fIkludge\fR [,\fIkludge\fR...] .RS 4 Enable specific kludges to work around non\-conforming WMs and/or stalonetray bugs\&. Argument is a comma\-separated list of: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBfix_window_pos\fR \(em fix tray window position on erroneous moves by WM .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBforce_icons_size\fR \(em ignore resize events on all icons; force their size to be equal to \fBicon_size\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBuse_icons_hints\fR \(em use icon window hints to determine icon size .RE .RE .PP \fB\-\-max\-geometry\fR \fIgeometry_spec\fR, \fBmax_geometry\fR \fIgeometry_spec\fR .RS 4 Set tray`s maximal geometry to \fIgeometry_spec\fR Default value: \fB0x0\fR, no limit\&. .RE .PP \fB\-\-no\-shrink\fR, \fBno_shrink\fR [\fIbool\fR] .RS 4 Do not shrink tray window back after icon removal\&. Useful when tray is swallowed by another window like FvwmButtons\&. Default value: \fBfalse\fR\&. .RE .PP \fB\-p\fR, \fB\-\-parent\-bg\fR, \fBparent_bg\fR [\fIbool\fR] .RS 4 Use the parent\*(Aqs window as a background of the tray\*(Aqs window\&. Default value: \fBfalse\fR\&. .RE .PP \fB\-\-pixmap\-bg \fR\fB\fIpath_to_xpm\fR\fR, \fBpixmap_bg\fR \fIpath_to_xpm\fR .RS 4 Use the pixmap from an XPM file specified by \fIpath_to_xpm\fR for the tray`s window background (pixmap will be tiled to fill the entire window)\&. .RE .PP \fB\-r\fR \fIname\fR, \fB\-\-remote\-click\-icon\fR \fIname\fR .RS 4 Remote control/click\&. When this option is specified, stalonetray sends a fake click to the icon with a window named \fIname\fR and exits\&. The icon is searched for in the currently active tray for the current screen\&. By default, stalonetray sends a single click with the 1st mouse button to the center of the icon\&. See the options below for additional information on how to alter the defaults\&. .RE .PP \fB\-\-remote\-click\-button\fR \fIn\fR .RS 4 Sets the remote click\*(Aqs button number to \fIn\fR (in the X11 numbering order)\&. .RE .PP \fB\-\-remote\-click\-position\fR \fIx\fRx\fIy\fR .RS 4 Sets the remote click\*(Aqs position\&. .RE .PP \fB\-\-remote\-click\-type\fR \fItype\fR .RS 4 Sets the remote click\*(Aqs type\&. Possible values: \fBsingle\fR and \fBdouble\fR\&. .RE .PP \fB\-s\fR \fIn\fR, \fB\-\-slot\-size\fR \fIn\fR, \fBslot_size\fR \fIn\fR .RS 4 Set grid slot size to \fIn\fR, which cannot be less then \fBicon_size\fR\&. By default, the slot size is the same as the icon size\&. .RE .PP \fB\-\-scrollbars\fR \fImode\fR, \fBscrollbars\fR \fImode\fR .RS 4 Set scrollbar mode\&. Possible values: \fBvertical\fR, \fBhorizontal\fR, \fBall\fR, or \fBnone\fR (default)\&. Scrollbars appear as additional space at tray borders that can be clicked to scroll icon area\&. Mouse wheel also works\&. .RE .PP \fB\-\-scrollbars\-highlight\fR \fImode\fR, \fBscrollbars_highlight\fR \fImode\fR .RS 4 Set scrollbars highlight mode\&. Possible values: a color spec, or \fBdisable\fR\&. .RE .PP \fB\-\-scrollbars\-size\fR \fIn\fR, \fBscrollbars_size\fR \fIn\fR .RS 4 Set scrollbar size to \fBn\fR pixels\&. By default, the size is 1/4 of \fBslot_size\fR\&. .RE .PP \fB\-\-scrollbars\-step\fR \fIn\fR, \fBscrollbars_step\fR \fIn\fR .RS 4 Set scrollbar step to \fBn\fR pixels\&. Default is 1/2 of \fBslot_size\fR\&. .RE .PP \fB\-\-skip\-taskbar\fR, \fBskip_taskbar\fR [\fIbool\fR] .RS 4 Hide tray`s window from the taskbar\&. Default value: \fBfalse\fR\&. .RE .PP \fB\-\-sticky\fR, \fBsticky\fR [\fIbool\fR] .RS 4 Make tray`s window sticky across multiple desktops/pages\&. Default value: \fBfalse\fR\&. .RE .PP \fB\-\-tint\-color\fR, \fBtint_color\fR [\fIbool\fR] .RS 4 Set tinting color\&. Default value: \fBwhite\fR\&. .RE .PP \fB\-\-tint\-level\fR, \fBtint_level\fR [\fIlevel\fR] .RS 4 Set tinting level\&. Default value: \fB0\fR (tinting disabled)\&. .RE .PP \fB\-t\fR, \fB\-\-transparent\fR, \fBtransparent\fR [\fIbool\fR] .RS 4 Enable root transparency\&. Default value: \fBfalse\fR\&. .RE .PP \fB\-v\fR, \fB\-\-vertical\fR, \fBvertical\fR [\fIbool\fR] .RS 4 Use vertical layout of icons (horizontal is used by default)\&. .RE .PP \fB\-\-window\-layer\fR \fIlayer\fR, \fBwindow_layer\fR \fIlayer\fR .RS 4 Sets the EWMH\-compliant layer of tray`s window\&. Possible values for \fIlayer\fR: \fBbottom\fR, \fBnormal\fR, \fBtop\fR\&. Default value: \fBnormal\fR\&. .RE .PP \fB\-\-window\-strut\fR \fImode\fR, \fBwindow_strut\fR \fImode\fR .RS 4 Enable window struts for tray window (to avoid covering of tray window by maximized windows)\&. Mode defines to which screen border tray window will be attached\&. It can be either \fBtop\fR, \fBbottom\fR, \fBleft\fR, \fBright\fR, \fBnone\fR, or \fBauto\fR (default)\&. .RE .PP \fB\-\-window\-type\fR \fItype\fR, \fBwindow_type\fR \fItype\fR .RS 4 Sets the EWMH\-compliant type of tray`s window\&. Possible values for \fItype\fR: \fBdesktop\fR, \fBdock\fR, \fBnormal\fR, \fBtoolbar\fR, \fButility\fR\&. Default value: \fBdock\fR\&. .RE .PP \fB\-\-xsync\fR, \fBxsync\fR [\fIbool\fR] .RS 4 Operate on X server synchronously (\fISLOW\fR, turned off by default)\&. .RE .SH "DEPRECATIONS" .PP As of stalonetray 0\&.8, the following command line and configuration file parameters are deprecated: .PP \fB\-\-dbg\-level\fR, \fBdbg_level\fR .RS 4 Please use \fB\-\-log\-level\fR instead\&. .RE .PP \fB\-\-max\-tray\-width\fR, \fB\-\-max\-tray\-height\fR, \fBmax_tray_width\fR, \fBmax_tray_height\fR .RS 4 Please use \fB\-\-max\-geometry\fR instead\&. .RE .PP \fB\-w\fR, \fB\-\-withdrawn\fR, \fBwithdrawn\fR .RS 4 Please use \fB\-\-dockapp\-mode\fR instead\&. .RE .PP \fB\-\-respect\-icon\-hints\fR, \fBrespect_icon_hints\fR .RS 4 Please use \fB\-\-kludges\fR with \fBuse_icon_hints\fR parameter instead\&. .RE .SH "FILES" .PP $HOME/\&.stalonetrayrc \(em default configuration file\&. .SH "BUGS" .PP There are some, definetly\&. .PP If you have found a bug, please try to reproduce it with the log level set to \fBtrace\fR and send the log file to me: \&. If you need support, the best way to get it is also to e\-mail me directly\&. If you have installed stalonetray from a distribution repository, you can also file a bug in the respective bug tracking database\&. .SH "AUTHOR" .PP \fBRoman Dubtsov\fR .RS 4 .RE stalonetray-0.8.3/depcomp0000755000175000017500000005601612404035727014530 0ustar varunvarun#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: stalonetray-0.8.3/INSTALL0000644000175000017500000002202410751351740014173 0ustar varunvarunCopyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. stalonetray-0.8.3/Makefile.in0000644000175000017500000006634012475441244015224 0ustar varunvarun# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) COPYING TODO \ depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ kde_tray_support = @kde_tray_support@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src man_MANS = stalonetray.1 doc_DIST = stalonetrayrc.sample stalonetray.1 stalonetray.xml stalonetray.html EXTRA_DIST = $(doc_DIST) stalonetray.spec stalonetray.xml.in stalonetrayrc.sample.in # $(debian_DIST) MAINTAINERCLEANFILES = stalonetray.1 stalonetray.html stalonetray.spec stalonetray.xml stalonetrayrc.sample ChangeLog all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 dist_hook: stalonetray.1 stalonetray.html stalonetray.xml: stalonetray.xml.in configure.ac stalonetrayrc.sample: stalonetrayrc.sample.in configure.ac stalonetray.spec: stalonetray.spec.in configure.ac stalonetray.xml \ stalonetrayrc.sample \ stalonetray.spec: VERSION_STR=`echo @VERSION@ | sed 's/\([^\.]*\.[^\.]*\)\..*/\1/'`; \ cat $< | sed "s/@VERSION_STR@/$$VERSION_STR/g" > $@ stalonetray.1: stalonetray.xml # xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl stalonetray.xml xsltproc /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl stalonetray.xml stalonetray.html: stalonetray.xml # xsltproc /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl stalonetray.xml > stalonetray.html xsltproc /usr/share/sgml/docbook/xsl-stylesheets/xhtml/docbook.xsl stalonetray.xml > stalonetray.html ChangeLog: svn update svn2cl --linelen=90 --break-before-msg=2 #docdir=$(datadir)/doc/$(PACKAGE)/ #install-data-local: # mkdir -p $(DESTDIR)/$(docdir) # cp AUTHORS BUGS COPYING NEWS README stalonetrayrc.sample $(DESTDIR)/$(docdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: stalonetray-0.8.3/NEWS0000644000175000017500000000437612461516774013665 0ustar varunvarun0.8 news - Remote control. Now it is possible to execute clicks on icons windows from command line. See documentation on --remote-click option for more info - Support for window struts EWMH property: now maximized windows do not cover stalonetray window. See documentation on --window-strut option for more info. - In addition to --icon-size which defines default icon size, now there is also a --slot-size which defines size of slot containing an icon. - Initial and maximal tray window dimensions are now specified in slot_size multiples - Scrollbars: now tray window has extra border, which user can click on to scroll icon area. This means that one can have fixed-size tray window (usefull when it is swallowed by FvwmButtons). See documentation on --scrollbars option for more info. This feature is experimental. - Semi-ugly support for WindowMaker dockapp mode. See documentation on --dockapp-mode option for more info. Notable fixes: - fix NetBSD build bug - fix EWMH window type support Some command line and configuration file options were deprecated, see DEPRECATIONS section of manpage for more info. 0.7.6 news - fix bug with sticky mode under Openbox - fix bug with disappearing window under WindowMaker (sf.net bug #1858069) - fix layout bug which prevented tray to shrink properly - fix resizing bug when grow gravity seemed to be ignored - fix regression: KDE icons are collected at startup again - fix focus model so that it (more-or-less) matches ICCM 0.7.5 news - fix silly bug with window states (sticky works now) - code cleanup in xembed implementation 0.7.4 news - fix sample rc file (Debian bug #446899) - fix fallback support mode for KDE icons (now KDE icons work in Xmonad) - detect if stalonetrays` window is no longer toplevel and do not try to fix geometry (fixes excessive CPU usage as reported in Debian bug #444748) 0.7.3 news - fix freedesktop.org icons support on amd64 (Debian bug #445056) 0.7.2 news - fix typo in parameter name for maximal tray height (Debian bug #444717) 0.7.1 news: - fix crash on invalid rc file (Debian bug #443543) - fix occasional KDE icons disappearance (sf.net bug #1676375) 0.7 release highlights: - tinting and fuzzy edges - layout improvements - XEMBED implementation fixes - massive code cleanup stalonetray-0.8.3/stalonetray.spec0000644000175000017500000000222212475441267016372 0ustar varunvarunSummary: STand Alone TRAY (notification area) implementation Name: stalonetray Version: 0.8 Release: 0 License: GPL Group: User Interface/X BuildRoot: %{_tmppath}/%{name}-buildroot Source: http://belnet.dl.sourceforge.net/sourceforge/stalonetray/stalonetray_0.8.tar.gz URL: http://sourceforge.net/projects/stalonetray Packager: Roman Dubtsov BuildRequires: libx11-devel BuildRequires: glibc-devel %description The stalonetray is a STAnd-aLONE system TRAY (notification area). It has minimal build and run-time dependencies: the Xlib only. The XEMBED support is planned. Stalonetray runs under virtually any window manager. %prep rm -rf ${RPM_BUILD_ROOT} %setup -q %build %configure make make check %install rm -rf ${RPM_BUILD_ROOT} %makeinstall #make DESTDIR=%buildroot install %files %doc README %doc NEWS %doc COPYING %doc AUTHORS %doc ChangeLog %doc stalonetrayrc.sample %doc stalonetray.html %doc stalonetray.xml %{_bindir}/* %{_mandir}/man*/* %changelog * Thu Dec 28 2006 Roman Dubtsov - new upstream release * Tue Mar 28 2006 Roman Dubtsov - initial rpmization stalonetray-0.8.3/configure0000755000175000017500000057510112475441245015067 0ustar varunvarun#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for stalonetray 0.8.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='stalonetray' PACKAGE_TARNAME='stalonetray' PACKAGE_VERSION='0.8.3' PACKAGE_STRING='stalonetray 0.8.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS kde_tray_support X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_x enable_native_kde enable_debug enable_events_trace enable_embedding_confirmation_delay enable_dump_win_info enable_graceful_exit ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures stalonetray 0.8.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/stalonetray] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of stalonetray 0.8.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-native-kde disable native kde tray icons support --enable-debug enable debugging output\checks --enable-events-trace enable full event trace (debug) --enable-embedding-confirmation-delay delay sending of embedding confirmation (debug) --enable-dump-win-info use xprop/xwininfo to dump icon window info --enable-graceful-exit use non-portable hack to exit gracefuly on signal Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF stalonetray configure 0.8.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by stalonetray $as_me 0.8.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" am__api_version='1.13' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='stalonetray' VERSION='0.8.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h for ac_header in ctype.h do : ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" if test "x$ac_cv_header_ctype_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CTYPE_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "ctype.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in errno.h do : ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" if test "x$ac_cv_header_errno_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERRNO_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "errno.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "signal.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in stdio.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDIO_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "stdio.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "stdlib.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "string.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in time.h do : ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" if test "x$ac_cv_header_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TIME_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "time.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "unistd.h is not found. See \`config.log' for more details" "$LINENO" 5; } fi done for ac_header in libgen.h do : ac_fn_c_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" if test "x$ac_cv_header_libgen_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEN_H 1 _ACEOF fi done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { void *array[10]; size_t size; size = backtrace(array, 10); backtrace_symbols_fd(array, size, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_var_backtrace=yes else ac_cv_var_backtrace=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$ac_cv_var_backtrace = xyes; then $as_echo "#define HAVE_BACKTRACE 1" >>confdefs.h else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { printstack(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_var_printstack=yes else ac_cv_var_printstack=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test x$ac_cv_var_printstack = xyes; then $as_echo "#define HAVE_PRINTSTACK 1" >>confdefs.h fi fi no_x="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test "x$no_x" = "xyes"; then echo "X11 libraries/headers could not be found." echo "If they are definetly installed, use" echo " --x-includes and --x-libraries to set the paths." echo echo "Aborting" echo exit 1 fi ac_cv_xpm_supported=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReadFileToPixmap in -lXpm" >&5 $as_echo_n "checking for XpmReadFileToPixmap in -lXpm... " >&6; } if ${ac_cv_lib_Xpm_XpmReadFileToPixmap+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm $X_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmReadFileToPixmap (); int main () { return XpmReadFileToPixmap (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xpm_XpmReadFileToPixmap=yes else ac_cv_lib_Xpm_XpmReadFileToPixmap=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5 $as_echo "$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; } if test "x$ac_cv_lib_Xpm_XpmReadFileToPixmap" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXPM 1 _ACEOF LIBS="-lXpm $LIBS" else ac_cv_xpm_supported=no fi case "$ac_cv_xpm_supported" in yes) $as_echo "#define XPM_SUPPORTED 1" >>confdefs.h ;; *) ;; esac feature_list="XPM:$ac_cv_xpm_supported" # Check whether --enable-native-kde was given. if test "${enable_native_kde+set}" = set; then : enableval=$enable_native_kde; ac_cv_no_native_kde="$enableval" else ac_cv_no_native_kde="yes" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; ac_cv_debug="$enableval" else ac_cv_debug="yes" fi # Check whether --enable-events-trace was given. if test "${enable_events_trace+set}" = set; then : enableval=$enable_events_trace; ac_cv_events_trace="$enableval" else ac_cv_events_trace="yes" fi # Check whether --enable-embedding-confirmation-delay was given. if test "${enable_embedding_confirmation_delay+set}" = set; then : enableval=$enable_embedding_confirmation_delay; $as_echo "#define DELAY_EMBEDDING_CONFIRMATION 1" >>confdefs.h LDFLAGS="$LDFLAGS -lpthread" fi # Check whether --enable-dump-win-info was given. if test "${enable_dump_win_info+set}" = set; then : enableval=$enable_dump_win_info; ac_cv_dump_win_info="$enableval" else ac_cv_dump_win_info="yes" fi # Check whether --enable-graceful-exit was given. if test "${enable_graceful_exit+set}" = set; then : enableval=$enable_graceful_exit; ac_cv_graceful_exit="$enableval" else ac_cv_graceful_exit="yes" fi case "$ac_cv_debug" in yes) $as_echo "#define DEBUG 1" >>confdefs.h if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -g" else echo "INFO: Since you use non-gcc compiler, please enable generation of debug info" echo " for your compiler manually (via CFLAGS shell variable)" fi ;; *) ;; esac feature_list="$feature_list DEBUG:$ac_cv_debug" kde_tray_support="kde_tray.o" case "$ac_cv_no_native_kde" in no) $as_echo "#define NO_NATIVE_KDE 1" >>confdefs.h kde_tray_support="" ;; *) ;; esac case "$ac_cv_dump_win_info" in yes) $as_echo "#define ENABLE_DUMP_WIN_INFO 1" >>confdefs.h ;; *) ;; esac case "$ac_cv_graceful_exit" in no) ;; *) $as_echo "#define ENABLE_GRACEFUL_EXIT_HACK 1" >>confdefs.h ;; esac case "$ac_cv_events_trace" in yes) $as_echo "#define TRACE_EVENTS 1" >>confdefs.h ;; *) ;; esac feature_list="$feature_list KDE:$ac_cv_no_native_kde" CPPFLAGS="$CPPFLAGS -DFEATURE_LIST='\"$feature_list\"'" ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by stalonetray $as_me 0.8.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ stalonetray config.status 0.8.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "*" echo "* Debug : $ac_cv_debug" if test "x$ac_cv_debug" = "xyes" -a "x$GCC" != "xyes"; then echo "* Since you are not using gcc compatible compiler, please" echo "* set debug CFLAGS manually (if you want to)" fi echo "* Native KDE support : $ac_cv_no_native_kde" echo "* XPM background support : $ac_cv_xpm_supported" echo "* Graceful exit support : $ac_cv_graceful_exit" echo "*" stalonetray-0.8.3/stalonetrayrc.sample.in0000644000175000017500000001310712461504711017644 0ustar varunvarun# vim:filetype=config:tw=80:et # # This is sample ~/.stalonetrayrc, resembling default configuration. # Remember: command line parameters take precedence. # # Directives introduced in @VERSION_STR@ are marked with "NEW in @VERSION_STR@" # #################################################################### # # stalonetray understands following directives # #################################################################### # background # color can be specified as an HTML hex triplet or # as a name from rgb.txt, note that '#' must be quoted background "#777777" # decorations # set trays window decorations; possible values for # decspec are: all, title, border, none decorations none # display # as usual # dockapp_mode # set dockapp mode, which can be either simple (for # e.g. OpenBox, wmaker for WindowMaker, or none # (default). NEW in @VERSION_STR@. dockapp_mode none # fuzzy_edges [] # enable fuzzy edges and set fuzziness level. level # can be from 0 (disabled) to 3; this setting works # with tinting and/or transparent and/or pixmap # backgrounds fuzzy_edges 0 # geometry # tray's geometry in standard X notation; width and # height are specified in slot_size multiples geometry 1x1+0+0 # grow_gravity # one of N, S, E, W, NW, NE, SW, SE; tray will grow # in the direction opposite to one specified by # grow_gravity; if horizontal or vertical # direction is not specified, tray will not grow in # that direction grow_gravity NW # icon_gravity # icon placement gravity, one of NW, NE, SW, SE icon_gravity NW # icon_size # specifies dimensions of typical icon slot icon_size 24 # log_level # controls the amount of logging output, level can # be err (default), info, or trace (enabled only # when stalonetray configured with --enable-debug) # NEW in @VERSION_STR@. log_level err # kludges kludge[,kludge] # enable specific kludges to work around # non-conforming WMs and/or stalonetray bugs. # NEW in @VERSION_STR@. Argument is a # comma-separated list of # * fix_window_pos - fix tray window position on # erroneous moves by WM # * force_icons_size - ignore resize events on all # icons; force their size to be equal to # icon_size # * use_icon_hints - use icon window hints to # dtermine icon size # max_geometry # maximal tray dimensions; 0 in width/height means # no limit max_geometry 0x0 # no_shrink [] # disables shrink-back mode no_shrink false # parent_bg [] # whether to use pseudo-transparency # (looks better when reparented into smth like FvwmButtons) parent_bg false # pixmap_bg # use pixmap from specified xpm file for (tiled) background # pixmap_bg /home/user/.stalonetraybg.xpm # scrollbars # enable/disable scrollbars; mode is either # vertical, horizontal, all or none (default) # NEW in @VERSION_STR@. scrollbars none # scrollbars-size # scrollbars step in pixels; default is slot_size / 4 # scrollbars-step 8 # scrollbars-step # scrollbars step in pixels; default is slot_size / 2 # scrollbars-step 32 # slot_size # specifies size of icon slot, defaults to # icon_size NEW in @VERSION_STR@. # skip_taskbar [] # hide tray`s window from the taskbar skip_taskbar true # sticky [] # make a tray`s window sticky across the # desktops/pages sticky true # tint_color # set tinting color tint_color white # tint_level # set tinting level; level ranges from 0 (disabled) # to 255 tint_level 0 # transparent [] # whether to use root-transparency (background # image must be set with Esetroot or compatible utility) transparent false # vertical [] # whether to use vertical layout (horisontal layout # is used by default) vertical false # window_layer # set the EWMH-compatible window layer; one of: # bottom, normal, top window_layer normal # window_strut # enable/disable window struts for tray window (to # avoid converting of tray window by maximized # windows); mode defines to which screen border tray # will be attached; it can be either top, bottom, # left, right, none or auto (default) window_strut auto # window_type # set the EWMH-compatible window type; one of: # desktop, dock, normal, toolbar, utility window_type dock # xsync [] # whether to operate on X server synchronously (SLOOOOW) xsync false stalonetray-0.8.3/missing0000755000175000017500000001533112404035727014545 0ustar varunvarun#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: stalonetray-0.8.3/ChangeLog0000644000175000017500000016074412461517560014734 0ustar varunvarun2015-02-04 04:21 busa_ru * Makefile.am, configure.ac: [u] bump version number to 0.8.2 (this is a release commit) 2015-02-04 04:12 busa_ru * NEWS, stalonetray.xml.in: [f] numerous typos 2015-02-03 20:41 busa_ru * Makefile.am, configure.ac, configure.in, src/Makefile.am: [f] Modernize autotools usage 2015-02-03 20:41 busa_ru * stalonetray.xml.in: [f] add author info to stalonetray.xml to make manpages xslt happy 2015-02-02 20:17 busa_ru * src/tray.c, src/wmh.h: [f] set _NET_WM_STRUTS_PARTIAL correctly (kudos to Mario Pilz for the patch) The original e-mail follows: I noticed strange behaviour of my window manager when using stalonetray on a 2-screen setup. Coincidentally i noticed that the tray did not set _NET_WM_STRUTS_PARTIAL correctly. An example: I configured stalonetry to reserve 28 pixels on the top edge of the screen starting 1000 pixels from the left with a width of 280 pixels. The tray then set: _NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 28, 0, 0, 0, 1000, 0, 0, 0, 1280, 0 According to the specification[1] it should be: _NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 28, 0, 0, 0, 0, 0, 1000, 1279, 0, 0 After going through the source i found the problems causing this: 1) the indices used to set the struts were wrong 2) the end values of the struts were calculated by simply adding the window width/height to the start value. This resulted in one pixel too much. (The first pixel the tray did not want to reserve instead of the last it wanted to) 2015-02-02 20:17 busa_ru * src/tray.h: [f] remove KLUDGE_FORCE_ICONS_SIZE/KLUDGE_USE_ICONS_HINTS value collision 2015-02-02 20:17 busa_ru * src/settings.c: [f] combine different kludge flags when parsing cmdline/rcfile 2015-02-02 20:17 busa_ru * src/debug.c, src/embed.c, src/icons.c, src/layout.c, src/settings.c: [f] fix some bugs from cppcheck & lint 2015-02-02 20:17 busa_ru * src/main.c: [f] check if dpy is valid when cleaning up. Fixes Mayhem bug 37431 and Debian bug 716356. 2015-02-02 20:17 busa_ru * stalonetrayrc.sample.in: [f] typos in stalontrayrc.sample Fixes Debian bug 718233. 2015-02-02 20:17 busa_ru * README: [f] log level recommendaton in README 2015-02-02 20:17 busa_ru * src/wmh.c: [f] _NET_WM_DESKTOP support Root cause: uninitialized value in ewmh_set_window_atom32(). Thanks to Sasha Vasko for the report. 2015-02-02 20:17 busa_ru * README, TODO, configure.in, src/debug.c, src/debug.h, src/embed.c, src/embed.h, src/icons.c, src/icons.h, src/image.c, src/image.h, src/kde_tray.c, src/layout.c, src/list.h, src/main.c, src/scrollbars.c, src/scrollbars.h, src/settings.c, src/settings.h, src/tray.c, src/tray.h, src/wmh.c, src/xembed.c, src/xutils.c, src/xutils.h, stalonetrayrc.sample.in, utils/get_props/main.c, utils/tray-test-fdo/main.c, utils/tray-xembed-test/common.h, utils/tray-xembed-test/debug.c, utils/tray-xembed-test/main.c, utils/tray-xembed-test/xutils.c: [f] trailing whitespaces 2015-02-02 20:17 busa_ru * src/settings.c: [+] print feature list on startup 2011-02-20 15:20 busa_ru * src/main.c, src/tray.c, src/tray.h: [+] support _NET_WM_PING 2010-11-06 14:16 busa_ru * stalonetray.xml.in: [f] typos/grammar in stalonetray.xml.in - this is a release commit for 0.8.1. 2010-11-06 14:15 busa_ru * configure.in: [f] fix handling of configure parameters --disable-dump-win-info and --disable-graceful-exit now work properly. 2010-11-06 14:14 busa_ru * Makefile.am: [u] update XSLT tools locations to match Fedora 2010-10-13 08:03 busa_ru * src/settings.c: [f] make sure that --window-* options are defined as having mandatory parameters 2010-08-02 00:56 busa_ru * src/layout.c: [f] do not reset is_updated flag in layout functions that set it 2009-11-16 03:39 busa_ru * src/debug.c, src/debug.h, src/main.c: [f] Fix handling of SIGPIPE: disable all console output 2009-11-13 18:20 busa_ru * configure.in, src/main.c, src/xutils.c, src/xutils.h, stalonetray.xml.in: [+] fix typos in manpage [+] bring async-dpy hack back (sigh...) 2009-10-24 15:33 busa_ru * stalonetray.xml.in: [f] update manpage on geometry 2009-10-23 09:54 busa_ru * src/main.c: [f] fix build failure for non-debug configuration 2009-10-21 16:16 busa_ru * TODO, configure.in, src/main.c, src/tray.c, src/tray.h, utils/tray-test-gtk/traytest: [+] bump version up to 0.8.0 (this is a release commit) [f] update window struts on every configure event 2009-10-18 17:25 busa_ru * configure.in, src/settings.c, stalonetray.xml.in: [+] bump beta version up to 2 [+] add documentation regarding scrollbar highlighting 2009-10-13 10:13 busa_ru * src/scrollbars.c, src/scrollbars.h, src/settings.c, src/settings.h, src/xutils.c, src/xutils.h: [+] moderate code refactoring [+] implement scrollbars highlighting (makes it much easier to find them) 2009-10-12 02:21 busa_ru * TODO, src/debug.c, src/debug.h, src/settings.c, src/tray.c: [f] order of options in --help output [f] amount of info and proper date formatting in trace mode [f] implement proper calculation of tray max/orig dimensions in interpret_settings() 2009-10-07 03:09 busa_ru * NEWS, configure.in, src/debug.h: [+] bump beta version number 2009-10-07 02:28 busa_ru * TODO, stalonetray.xml.in: [f] typoss and rewording in manpage 2009-10-02 03:33 busa_ru * stalonetray.xml.in: [+] fix typo in manpage 2009-10-02 03:25 busa_ru * NEWS, configure.in: [+] bump version to beta0 [+] add news for 0.8 2009-09-28 14:49 busa_ru * src/settings.c: [f] fix max geometry normalization 2009-09-28 03:13 busa_ru * src/wmh.h: [f] Fix window strut on x86_64 2009-09-21 12:15 busa_ru * PORTING, TODO, configure.in, doc, src/common.h, src/debug.c, src/debug.h, src/embed.c, src/icons.c, src/image.c, src/kde_tray.c, src/layout.c, src/main.c, src/scrollbars.c, src/settings.c, src/settings.h, src/tray.c, src/wmh.c, src/xembed.c, src/xutils.c, src/xutils.h, stalonetray.xml.in, stalonetrayrc.sample.in: [f] code cleanup: - get rid of DBG levels and friends, use 3 log classes: ERR, INFO and TRACE; --dbg-level is now --log-level - get rid of extra blank lines - rework some trace/error messages - get rid of dump_icon_list() calls [f] remove stale docs [+] update documentation and sample rc file [f] max geometry now cannot be smaller than geometry 2009-09-14 15:47 busa_ru * Makefile.am, TODO, configure.in, src/IDEAS, src/ISSUES, src/debug.c, src/layout.c, src/layout.h, src/main.c, src/scrollbars.c, src/scrollbars.h, src/settings.c, src/settings.h, src/tray.c, src/tray.h, src/wmh.c, src/xutils.c, src/xutils.h, stalonetray.xml.in, utils/tray-test-fdo/main.c: [+] bump alpha revision to 3 [+] make tray window name adjustable via --window-name [+] implement remote icon clicking [f] make scrollbars gravity-aware (fix icon placement) [f] cleanups in main event loop: use XNextEvent() always [f] some fixes from valgrind logs 2009-08-26 05:54 busa_ru * TODO, src/settings.c: [f] Add missing initialization of tray dimensions 2009-08-15 06:58 busa_ru * TODO, src/embed.c, src/main.c, src/scrollbars.c, src/settings.c, src/settings.h, src/tray.c, src/tray.h, src/xembed.c, stalonetray.xml.in: [f] Misc source code cleanups [f] Fix for wmaker mode (appear as a dockapp) [+] Move --ignore-icon-resize and --respect-icon-hints under --kludge option [f] Geometry code fixes (use proper hints, etc) 2009-07-30 11:56 busa_ru * TODO, configure.in, src/main.c, src/scrollbars.c, src/settings.c, src/settings.h, src/tray.c, src/tray.h, src/wmh.c, src/wmh.h, stalonetray.xml.in, utils/tray-test-gtk/traytest: * implement window struts * implement basic support for WMaker dockapp mode (deprecates --withdrawn) * update documentation 2009-03-27 17:56 busa_ru * ., TODO, src/Makefile.am, src/embed.c, src/layout.c, src/layout.h, src/main.c, src/scrollbars.c, src/scrollbars.h, src/settings.c, src/settings.h, src/tray.c, src/tray.h: Merge in scrollbars branch 2008-12-27 04:32 busa_ru * src/main.c: * update expose_notify() so that refresh happens only on the last event of a sequence 2008-12-27 04:30 busa_ru * src/embed.c: * update send_delayed_confirmation() (dont use async_dpy) 2008-08-05 06:58 busa_ru * src/main.c, src/tray.c, stalonetray.xml.in: * fix window position calucation in tray_update_window_size() * fix docs (typos and update wrt default settings) * add missing includes to main.c 2008-08-05 03:48 busa_ru * src/layout.c: * fix layout icon resize handler: backup grid dimensions and restore them in case of error 2008-08-02 10:11 busa_ru * src/kde_tray.c, src/layout.c, src/main.c, src/tray.c: * Increase amount of debug output * Move tray status dumper to separate function 2008-07-28 01:59 busa_ru * src/icons.c, src/main.c: * my_usleep(): fix so that it really sleeps * icon_list_new(): initialize num_size_resets (fixes icon embedding issues) 2008-07-05 09:12 busa_ru * src/kde_tray.c, src/kde_tray.h, src/main.c: * upd:property_notify():handle WM restarts and re-set tray hints and KDE support mode 2008-06-12 10:40 busa_ru * TODO, src/settings.c, stalonetray.xml.in, stalonetrayrc.sample.in: * add missing slot_size to sample rc file * add desktop to list of supported window types (+ update docs) 2008-04-17 07:32 busa_ru * TODO: 2008-04-17 06:26 busa_ru * src/common.h, src/embed.c, src/icons.h, src/main.c: Fixes for ignore_icon_resize behaviour * reset icon size to default if it tries to change its size * count attempts (for non-KDE icons), give up if they pass threshold Debugging enchancements * add define which changes mid-parent color to black 2008-03-23 17:15 busa_ru * src/embed.c: upd:minor comments update 2008-03-23 17:14 busa_ru * src/settings.c: fix:parse_rc():NetBSD build fix from Steve Bellovin 2008-03-23 17:12 busa_ru * src/layout.c, src/main.c, src/settings.c, src/settings.h, src/tray.c, stalonetray.xml.in: upd:all: transition to slot_size upd:interpret_settings(): minor cleanups upd:stalonetray.xml.in: minor fixes 2008-03-23 16:15 busa_ru * stalonetray.spec.in: upd: now depend on x11-devel As now there's Fedora package for stalonetray, spec file won't be actively maintained. 2008-03-20 18:07 busa_ru * configure.in: upd: bump version number 2008-03-20 18:06 busa_ru * TODO: 2008-02-10 18:54 busa_ru * src/main.c: fix:my_usleep(): simple sleep func that sleeps but does not block signals fix:main(): implement proper event loop with my_usleep fix:*:get rid of async_dpy ugliness 2008-02-10 18:51 busa_ru * src/tray.c, src/tray.h: del: struct TrayData: remove async_dpy field add: struct TryaData: add terminated field to serve as a termination flag 2008-02-10 18:31 busa_ru * src/xutils.c: upd:x11_wait_for_timestamp(): try to handle cases when the window being waited for gets destroyed 2008-02-10 17:52 busa_ru * src/main.c: upd:main(): list atoms supported by WM on startup upd:property_notify(): list atoms supported by WM on WM (re)starts 2008-02-10 17:51 busa_ru * src/tray.c: upd:tray_set_wm_hints(): update to match new EWMH API 2008-02-10 17:50 busa_ru * src/wmh.c, src/wmh.h: add:ewmh_wm_present(): func to check for EWMH-compliant WM upd:ewmh_add_window_state(): do not fail on WM not being available upd:ewmh_add_window_type(): do not fail on WM not being available add:ewmh_set_window_atom32(): func to set windows atom in EWMH-compliant way add:ewmh_list_supported_atoms(): func to list atoms supported by WM 2008-02-03 17:44 busa_ru * Makefile.am, NEWS, TODO, configure.in, src/debug.c, src/debug.h, src/embed.c, src/icons.h, src/kde_tray.c, src/layout.c, src/main.c, src/settings.c, src/settings.h, src/tray.c, src/tray.h, src/wmh.c, src/xembed.c, src/xembed.h, src/xutils.c, stalonetray.xml.in, stalonetrayrc.sample.in, utils/tray-test-fdo/main.c, utils/tray-xembed-test/main.c: Merged version 0.7 bugfixes branch 2007-09-22 13:45 busa_ru * TODO: 2007-09-21 14:31 busa_ru * Makefile.am: * update ChangeLog generation 2007-09-20 16:24 busa_ru * 2007-09-15 10:20 busa_ru * fix: image_tint_32(): fix loop condition so that _all_ pixels are tinted fix: image_tint_24(): fix loop condition so that _all_ pixels are tinted fix: image_tint_16(): fix loop condition so that _all_ pixels are tinted fix: image_tint_15(): fix loop condition so that _all_ pixels are tinted 2007-09-15 06:37 busa_ru * fix: add stalonetray.xml.in and stalonetrayrc.sample.in to the list of distributed files 2007-09-15 04:42 busa_ru * upd: cleanup(): sanitize debug levels upd: add_icon(): sanitize debug levels upd: remove_icon(): sanitize debug levels upd: icon_track_visibility_changes(): sanitize debug levels upd: kde_icons_update(): sanitize debug levels upd: perform_periodic_tasks(): sanitize debug levels upd: client_message(): sanitize debug levels upd: configure_notify(): sanitize debug levels upd: selection_clear(): sanitize debug levels upd: map_notify(): sanitize debug levels upd: main(): sanitize debug levels 2007-09-15 04:32 busa_ru * upd: layout_handle_icon_resize(): sanitize debug levels upd: grid2window(): sanitize debug levels upd: grid_add(): sanitize debug levels upd: grid_place_icon(): sanitize debug levels upd: icon_placement_create(): sanitize debug levels upd: icon_placement_choose_best(): sanitize debug levels upd: grid_find_placement(): sanitize debug levels 2007-09-15 04:29 busa_ru * fix: interpret_settings(): die on bad background color specification 2007-09-15 04:26 busa_ru * fix: get_args(): return SUCCESS/FAILURE instead of True/False upd: get_args(): die on OOM condition instead of returning False upd: get_args(): die on undhandled quotes disbalance upd: parse_rc(): sanitize debug levels fix: parse_rc(): check get_args() return value and die on error condition upd: interpret_settings(): die if unable to parse tint color upd: interpret_settings(): sanitize debug levels upd: read_settings(): sanitize debug levels 2007-09-15 04:22 busa_ru * upd: tray_init_pixmap_bg(): sanitize debug levels upd: tray_update_root_bg_pmap(): sanitize debug levels upd: tray_update_bg(): sanitize debug levels upd: tray_update_window_size(): sanitize debug levels upd: tray_create_window(): sanitize debug levels upd: tray_acquire_selection(): sanitize debug levels 2007-09-15 04:19 busa_ru * upd: ewmh_check_support(): sanitize debug levels upd: ewmh_dump_window_states(): sanitize debug levels 2007-09-15 04:18 busa_ru * upd: xembed_init(): sanitize debug levels upd: xembed_handle_event(): sanitize debug levels upd: xembed_switch_focus_to(): sanitize debug levels upd: xembed_track_focus_change(): sanitize debug levels upd: xembed_message(): sanitize debug levels upd: xembed_del_accel(): sanitize debug levels 2007-09-15 04:16 busa_ru * upd: x11_io_error_handler(): remove redundant DBG call upd: x11_error_handler(): sanitize debug levels upd: x11_set_window_size(): sanitize debug levels upd: x11_get_window_size(): sanitize debug levels upd: x11_get_window_min_size(): sanitize debug levels upd: x11_dump_win_info(): enable dumping of window info at debug level 8 2007-09-15 04:04 busa_ru * upd: kde_tray_init(): sanitize debug levels upd: kde_tray_old_icons_remove(): sanitize debug levels 2007-09-15 04:03 busa_ru * upd: image_tint(): die on invalid image depth instead of returning FAILURE upd: image_compose(): die on invalid image depth instead of returning FAILURE 2007-09-15 04:02 busa_ru * upd: icon_list_backup(): die on double-backup instead of returning FAILURE upd: icon_list_backup(): sanitize debug levels upd: icon_list_restore(): sanitize debug levels 2007-09-15 04:01 busa_ru * upd: embedder_embed(): sanitize debug levels upd: embedder_unembed(): sanitize debug levels upd: embedder_update_window_positions(): sanitize debug levels upd: embedder_refresh(): sanitize debug levels upd: embedder_reset_size(): sanitize debug levels 2007-09-15 03:24 busa_ru * upd: print_icon_data(): increase debug levels to 6 2007-09-15 03:21 busa_ru * fix: typo in @VERSION_STR@ substition string 2007-09-15 03:13 busa_ru * *** empty log message *** 2007-09-10 17:01 busa_ru * upd: tray_update_window_size(): add extra debuggin output upd: tray_create_window(): disable backing store when parent bg is on upd: tray_create_window(): restore PropertyChangeMask in call to XSelectInput() on tray window, it is requred for x11_get_server_timestamp() upd: tray_show_window(): update window size before mapping it 2007-09-10 16:50 busa_ru * upd: perform_periodic_tasks(): report grid geometry in icon_size multiples upd: perform_periodic_tasks(): report _real_ tray geometry from XGetWindowAttributes upd: perform_periodic_tasks(): add size-updating kludge to forse window size to one which is desired add: visibility_notify(): new function to handle visibility notifies (currently unused) upd: client_message(): call tray_update_window_size() after docking is confirmed upd: configure_notify(): add comments upd: main(): add visibility notify handling to main event loop 2007-09-10 16:43 busa_ru * upd: parse_cmdline(): update comments upd: struct Param params: add "-f" as short version of fuzzy_edges parameter 2007-09-10 16:41 busa_ru * upd: embedder_reset_size(): remove (now) redundant TODO 2007-09-10 16:36 busa_ru * fix: decorations is "none" by default (and not "all") 2007-09-10 16:35 busa_ru * upd: decorations option: mention no_deco and friends as depricated, add decspec to all terms upd: fuzzy_edges option: make level optional, mention default value when level is ommited 2007-09-10 16:31 busa_ru * upd: add all auto-generated files to mainaner-clean target 2007-09-10 16:30 busa_ru * *** empty log message *** 2007-09-10 16:28 busa_ru * *** empty log message *** 2007-09-10 16:11 busa_ru * update the list of bugs 2007-09-07 11:51 busa_ru * fix: property_notify(): call tray_refresh_window() also when fuzzy edges are used add: new func expose(): to handle exposures; refreshes tray window add: main(): handle Expose events in main loop 2007-09-07 11:45 busa_ru * fix: tray_create_window(): cleanup masks in call to XSelectInput() 2007-09-07 11:05 busa_ru * del: grid_update_icon_placement(): unused fix: grid_remove(): fix wording in comment 2007-09-07 10:05 busa_ru * fix: grid_remove(): fix implementation to handle shrink_back mode property 2007-09-07 10:05 busa_ru * *** empty log message *** 2007-09-07 05:52 busa_ru * upd: perform_periodic_tasks(): add call to tray_refresh_window() upd: property_notify(): update call to tray_refresh_window() to new signature upd:configure_notify(): update call to tray_refresh_window() to new signature 2007-09-07 05:51 busa_ru * fix: swap(): remove unecessary ';' in macro definition 2007-09-07 05:50 busa_ru * upd: embedder_update_positions(): make use of x11_refresh_window() 2007-09-07 05:49 busa_ru * upd: tray_refresh_window(): make use of x11_refresh_window() upd: tray_create_window(): mark XSelectInput() call for revision 2007-09-07 05:48 busa_ru * add: x11_send_visibility(): new func to send visibility notifies add: x11_send_expose(): new func to send exposures add: x11_refresh_window(): new func to refresh window`s contents 2007-09-05 11:34 busa_ru * *** empty log message *** 2007-09-05 11:33 busa_ru * fix: embedder_refresh(): fix nasty bug: do not try to refresh hidden icons 2007-09-05 11:33 busa_ru * upd: client_message(): add extra debug output 2007-09-05 11:01 busa_ru * upd: icon_placement_choose_best(): print some auxiliary debug info 2007-09-05 11:00 busa_ru * fix: tray_update_window_size(): set WM size hints _first_ (setting maximal tray size) and call XResizeWindow() after that upd: always call XResizeWindow() (who cares?) 2007-09-05 10:03 busa_ru * fix: grid2window(): make translation orientation-aware fix: grid_add(): set is_layout flag _before_ calling grid_place_icon() fix: icon_placement_create(): make calculation of validness orientation-aware fix: icon_placement_choose_best(): make calculation of window size deltas orientation-aware 2007-09-05 09:57 busa_ru * *** empty log message *** 2007-09-05 09:55 busa_ru * fix: property_notify(): always refresh window on wallp. change upd: property_notify(): update KDE icons list only if tray is active 2007-09-05 09:52 busa_ru * fix: tray_create_window(): fix withrawn mode: set icon_window WMH fix: tray_set_wm_hints(): compare strings using strcmp upd: tray_update_root_bg_pmap(): set rc=0 just in case 2007-09-05 09:47 busa_ru * fix: usage(): fix wording add: parse_rc(): show info about rc parameter being processed 2007-09-02 17:02 busa_ru * *** empty log message *** 2007-09-02 17:00 busa_ru * upd: implement automatic version string in docbook xml, RPM spec and sample rc file upd: add all new features into documentation upd: fix wording in documentation del: all non *.in files 2007-09-02 16:57 busa_ru * add: preliminary NEWS version for 0.7 2007-09-02 16:56 busa_ru * *** empty log message *** 2007-09-02 16:56 busa_ru * fix: show sf.net e-mail 2007-09-02 16:54 busa_ru * fix: usage(): fix wording 2007-08-31 16:58 busa_ru * *** empty log message *** 2007-08-31 16:54 busa_ru * upd: layout_handle_icon_resize(): updated to use dump_icon_list() fix: icon_placement_choose_best(): put back lost placement positions points comparison add: icon_placement_choose_best(): sync window deltas with layout deltas if tray size is larger than original 2007-08-31 15:59 busa_ru * *** empty log message *** 2007-08-31 15:58 busa_ru * upd: embedder_refresh(): backport changes from 0.6.x branch. respect ignore_icon_resize and respect_icon_hints settings upd: embedder_embed(): MAJOR CHANGE: reformat a little 2007-08-31 15:53 busa_ru * fix: kde_tray_update_old_icons(): fix x11_ok() usage fix: kde_tray_init(): fix x11_ok() usage, check return value of XQueryTree() fix: kde_tray_init(): leave list of old icons empty if there's no previous tray selection owner 2007-08-31 15:49 busa_ru * add: KDE_ICON_SIZE constant for ... KDE icon size! 2007-08-31 15:48 busa_ru * fix: property_notify(): call kde_icons_update() only if tray is active add: perform_periodic_tasks(): indicate whether tray is active upd: request_tray_status_on_signal(): implement asynchronous status request scheme: send fake tray opcode message with STALONE_TRAY_STATUS_REQUESTED opcode. 2007-08-31 15:46 busa_ru * add: respect_icon_hints setting (try to respect icon size hints) add: ignore_icon_resize setting (ignore icons attempts to resize its window) fix: interpret_settings: ensure that tray window width and height are multiples of icon_size before calculating window position 2007-08-31 15:40 busa_ru * fix: tray_update_root_bg_pmap(): fix x11_ok() usage add: STALONE_TRAY_STATUS_REQUESTED tray message opcode as a fake message to request tray data 2007-08-31 15:39 busa_ru * fix: ewmh_add_window_state(): fix usage of x11_ok() 2007-08-31 15:29 busa_ru * fix: x11_get_win_prop32(): correct calculation of property length upd: x11_ok(): add comment stating some usage guidelines 2007-08-28 16:44 busa_ru * upd: map_notify(): fix type in comment upd: configure_notify(): make use of dump_icon_list() upd: reparent_notify(): make use of dump_icon_list() upd: perform_periodic_tasks(): code cleanup, make use of dump_icon_list(), fix bug in non-debug version upd: add_icon(): remove bogus TODO upd: cleanup(): close async_dpy as well 2007-08-28 16:40 busa_ru * upd: embedder_unembed(): remove XXX upd: embedder_reset_size(): proper computation of kde_icon_size 2007-08-28 16:39 busa_ru * upd: interpret_settings(): set minimal cutoff value for settings.icon_size to MIN_ICON_SIZE upd: remove XXXs from parse_cmdline() and get_args() upd: FALLBACK_SIZE -> FALLBACK_ICON_SIZE rename 2007-08-28 16:37 busa_ru * upd: mark XRender TODO for 0.8 2007-08-28 16:35 busa_ru * upd: rename FALLBACK_SIZE -> FALLBACK_ICON_SIZE add: MIN_ICON_SIZE define for minimal icon size 2007-08-28 16:33 busa_ru * add: dump_icon_list(): common function which prints whole icon list with appropriate start/finish markers 2007-08-28 16:29 busa_ru * upd: remove XXX from tray_update_window_size() fix: tray_create_window(): proper error checking for XmbTextListToTextProperty() call 2007-08-28 16:28 busa_ru * add: x11_send_client_msg32(): comment about event mask 2007-08-28 16:26 busa_ru * add: comments about current implementation limitations add: (commented out) code that ignores XEMBED messages if they are late 2007-08-28 13:55 busa_ru * fix: tray_create_window(): die on XmbTextListToTextProperty() failure 2007-08-28 13:55 busa_ru * fix: x11_get_win_prop32(): always try to retrive 4 bytes from a property (from stalonetray-0.6.3-alt-gwp.patch) 2007-08-28 13:01 busa_ru * fix: icon_placement_choose_best(): use grid deltas * icon size as a cutoff maximum when computing window size deltas fix: icon_placement_choose_best(): always take window size deltas into account (and not only when shrink-back mode is off) 2007-08-28 12:58 busa_ru * *** empty log message *** 2007-08-28 12:44 busa_ru * fix: icon_placement_choose_best(): use grid deltas * icon size as a cutoff maximum when computing window size deltas fix: icon_placement_choose_best(): always take window size deltas into account (and not only when shrink-back mode is off) 2007-08-27 03:32 busa_ru * Fix crazy bug which caused icon list to be sorted inside the icon_list_for_all(). Details follow. upd: grid_add() no longer calls grid_update() fix: grid_update(): new parameter, sort: whether to sort icon list upd: grid_place_icon(): update grid dimensions if grid deletas as non-zero upd: layout_handle_icon_resize(): print list of icons that are to be added back to the grid fix: layout_handle_icon_resize(): if shrink back mode is on, ensure that the resulting layout is minimal by recalculating minimal grid size before starting to add icons back to the grid upd: layout_add(): manually call grid_update() if necessary Misc. changes: upd: remove unused (but declared) grid_rebuild() fix: icon_placement_create(): fix typo: settings.max_tray_height -> settings.max_layout_height upd: icon_placement_choose_best(): isolate window-size related parts using ifdefs upd: icon_placement_choose_best(): calculate and take into account window size deltas only if shrink-back mode is on fix: grid_recalc_size(): improve english in comment 2007-08-26 15:33 busa_ru * fix: tray_acquire_selection(): do not free tray_sel_atom_name, since it is used while re-acquiring tray selection fix: tray_update_window_size(): set tray maximal size if shrink back is on upd: tray_update_window_size(): cleanups fix: tray_update_bg(): gracefully handle absence of root pmap 2007-08-26 15:28 busa_ru * upd: remove useless comment 2007-08-26 15:25 busa_ru * fix: check window parameter value of WM_DELETE message to avoid SIDS 2007-08-26 15:21 busa_ru * *** empty log message *** 2007-08-14 15:50 busa_ru * *** empty log message *** 2007-08-14 15:47 busa_ru * add: tray_data.async_dpy which is used to send asynchronous messages to the tray as in exit_on_signal() handler in main.c 2007-08-14 15:37 busa_ru * fix: implement usleep()-less event loop, exit_on_signal() now sends a fake WM_DELETE_WINDOW event to the tray window using extra display fix: do not print icon list contents in USR1 handler, just set the flag which is handled in perform_periodic_tasks(); this removes possible race condition upd: remove USR2 handler, this is useless 2007-08-13 13:25 busa_ru * fix: replace CARD32/INT32 in definition of MWM window hints with longs 2007-08-13 13:24 busa_ru * fix: x11_get_win_prop32(): free buf only iff its non-null 2007-08-13 13:22 busa_ru * fix: tray_update_bg(): recreate final_pmap if it is None fix: tray_update_bg(): return from the function after disabling transparency fix: tray_create_window(): fix some leaks 2007-08-13 13:16 busa_ru * fix: interpret_settings(): parse tint color _after_ tint level value was sanitized and iff it is non-zero upd: minor update of usage() text 2007-08-13 13:10 busa_ru * *** empty log message *** 2007-08-10 15:35 busa_ru * fix: remove dependency on stdint.h, use CARD8, CARD16 and CARD32 instead of uint*_t stuff 2007-08-10 15:33 busa_ru * fix: add missing include of X.h 2007-08-10 15:27 busa_ru * *** empty log message *** 2007-08-07 15:51 busa_ru * upd: replaced --no-deco, --no-title and --no-border with single --decorations option upd: usage() now reflects the set of all available options 2007-08-07 15:34 busa_ru * *** empty log message *** 2007-08-05 16:14 busa_ru * *** empty log message *** 2007-08-05 16:00 busa_ru * upd: rename xembed_{next,prev}_icon() to xembed_{next,prev}() for consistency fix: use layout_{next,prev}() in xembed_{next,prev}() so that tab chain matches icon layout 2007-08-05 15:53 busa_ru * add: layout_{next,prev}() functions which are used in walking along tab chain. 2007-08-05 15:46 busa_ru * *** empty log message *** 2007-08-05 15:15 busa_ru * fix: reduce main event loop delay to 100000 usecs 2007-08-05 15:14 busa_ru * fix: initial (lame) implementation of xembed accel handling. nobody uses it anyway :) 2007-08-05 15:13 busa_ru * fix: take into account window size changes when choosing best placement 2007-08-04 17:10 busa_ru * fix: use exit_flag for gracefull exit and sleep 100 times longer in main event loop fix: start trapping x11 earlier fix: combine handlers for SIGINT, SIGKILL and SIGTER into one: sigdie() fix: check x11 connection status in cleanup() fix: update bg on wallpaper changes not only when the tray is root-transparent, but also when parent_bg is on 2007-08-04 16:52 busa_ru * fix: implement correct XEMBED events handling scheme fix: implement correct focus switching behaviour fix: really propagate keyboard events to the icons fix: implement correct focus request behaviour with new func xembed_request_focus_from_wm() fix: implement correct accel handling scheme (totest) 2007-08-04 16:46 busa_ru * fix: use DefaultRootWindow add: implement X11 io handler 2007-08-04 16:43 busa_ru * fix: use DefaultRootWindow() instead of RootWindow(dpy, ...) 2007-08-04 16:30 busa_ru * *** empty log message *** 2007-07-31 15:37 busa_ru * fix: replace x11_get_winlist_prop() with x11_get_win_prop32() and fix it add: x11_get_winlist_prop() macro to wrap around x11_get_win_prop32() fix: x11_error_handler() now reports request opcode and resource id add: x11_extend_root_event_mask() to incrementally modify event selection mask for root window 2007-07-31 15:32 busa_ru * fix: make use of x11_* calls from xutils in ewmh_add_window_type(), ewmh_check_support() and ewmh_dump_window_states() 2007-07-31 15:31 busa_ru * add: tray_refresh_window() which refreshes all the icons and tray window itself 2007-07-31 15:30 busa_ru * upd: minor updates to remove gcc warnings 2007-07-31 15:25 busa_ru * upd: code cleanup, comments, etc 2007-07-31 15:24 busa_ru * fix: add embedder_refresh() call to embedder_update_window_positiion() upd: comments, cleanup, etc 2007-07-31 15:22 busa_ru * fix: error handing in print_icon_data was broken and X11 error state was not reset in the end. 2007-07-31 15:19 busa_ru * *** empty log message *** 2007-07-22 16:54 busa_ru * *** empty log message *** 2007-07-22 16:34 busa_ru * add: --withdrawn cmdline param to control initial state of tray window 2007-07-22 16:21 busa_ru * add: x11_extend_root_event_mask() function to incrementally extend event mask of the root window. used in tray_create_window() and kde_tray_init() 2007-07-22 16:15 busa_ru * fix: bug in kde_tray_check_for_icon(): _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR property was not actually retrived fix: bug in kde_tray_find_icon(): must call self recursively instead of kde_tray_check_for_icon() add: legacy scheme for handling KDE icons based on tracking MapNotify. 2007-07-22 16:02 busa_ru * *** empty log message *** 2007-07-19 04:01 busa_ru * *** empty log message *** 2007-07-19 03:11 busa_ru * fix: implement clipping in tray_update_bg() add: store root window dimensions in tray_data (initialized in interpret_settings()) 2007-07-19 03:08 busa_ru * fix: --help was lacking any default value which resulted in crash fix: removed --edges-fuzziness-level, now --fuzzy-edges just takes a parameter 2007-07-19 03:00 busa_ru * fix: comment out unused variable in embedder_refresh() 2007-07-19 02:56 busa_ru * add: neat macros cutoff() and val_range() 2007-07-19 02:54 busa_ru * *** empty log message *** 2007-07-15 10:08 busa_ru * fix: tray_update_bg(): ask all icons to repaint themselves after background was updated. 2007-07-15 10:04 busa_ru * fix: code cleanup 2007-07-15 10:03 busa_ru * fix: *_mapped_state() use right array subscript 2007-07-15 09:58 busa_ru * fix: improve value stanitanization code in interpret_settings() 2007-07-15 09:35 busa_ru * *** empty log message *** 2007-07-15 09:21 busa_ru * fix: improve embedder_refresh() to produce less flicker 2007-07-15 09:19 busa_ru * *** empty log message *** 2007-07-05 15:02 busa_ru * add: support for 15/16/24 bit depths for composing/tinging images. Untested. 2007-07-05 15:00 busa_ru * fix: parse_cmdline(): fix parsing of stanalone arguments by rejecting standalone arguments that start with '-'. To be documented. 2007-07-01 16:39 busa_ru * add: fuzzy edges support add: tray_update_bg() completely rewritten. 2007-07-01 16:34 busa_ru * Added image.{c,h} for simple image manipulations. XRender support is planned. 2007-07-01 16:00 busa_ru * *** empty log message *** 2007-06-26 13:22 busa_ru * - fix: parse_cmdline() did not process optional args correctly. - add: add extra arg for parse_xxx() funcs: whether to fail silently 2007-06-22 16:26 busa_ru * *** empty log message *** 2007-06-18 07:58 busa_ru * *** empty log message *** 2007-02-26 18:19 busa_ru * *** empty log message *** 2007-02-03 19:12 busa_ru * Code cleanup stage 1: * comments were added * function names were adjusted Not thoroughly tested --- may be broken. 2007-01-10 16:24 busa_ru * *** empty log message *** 2007-01-05 06:40 busa_ru * *** empty log message *** 2007-01-04 15:46 busa_ru * * bump the version number * remove debian/ directory from source tarball 2007-01-04 15:33 busa_ru * *** empty log message *** 2007-01-04 13:31 busa_ru * * some refactoring * use only minimal size from window size hints * make dump_win_info() depend on ENABLE_DUMP_WIN_INFO 2007-01-04 08:33 busa_ru * * add read_wm_normal_hints() which is used to (more correctly) obtain icon geometry 2007-01-04 08:32 busa_ru * *** empty log message *** 2007-01-04 08:24 busa_ru * *** empty log message *** 2006-12-28 17:39 busa_ru * * correct version in debian/changelog * update debug CFLAGS in configure.in 2006-12-28 17:29 busa_ru * * fix compilation when XPM library is missing * update NEWS file 2006-12-27 06:34 busa_ru * * fix configure.in * fix some warnings 2006-12-26 13:52 busa_ru * upd: all versions bumped 2006-12-26 13:32 busa_ru * *** empty log message *** 2006-12-26 13:22 busa_ru * fix: kill the last XSync 2006-12-26 13:08 busa_ru * *** empty log message *** 2006-12-26 13:04 busa_ru * fix: added ifdef DEBUG to all print_icon_data calls 2006-12-26 12:57 busa_ru * * fixed trap/untrap_errors for nested calls support * fixed handle_icon_resize() * misc.fixes 2006-12-22 19:30 busa_ru * *** empty log message *** 2006-12-22 19:28 busa_ru * * update old kde icons list on resp. property notify 2006-12-22 16:20 busa_ru * *** empty log message *** 2006-12-22 16:18 busa_ru * * bumped vesrion to 0.6-pre0 * pixmap bg support * NEWS file updated * misc. cleanup 2006-12-20 18:40 busa_ru * *** empty log message *** 2006-12-20 18:39 busa_ru * * provide version info in --help output 2006-12-20 18:03 busa_ru * *** empty log message *** 2006-12-20 16:49 busa_ru * *** empty log message *** 2006-12-20 16:36 busa_ru * *** empty log message *** 2006-12-20 16:17 busa_ru * *** empty log message *** 2006-12-03 18:01 busa_ru * I'm too lazy to write commit messages 2006-12-03 17:56 busa_ru * *** empty log message *** 2006-11-27 18:52 busa_ru * * upd: commented out dump_win_info() until its fixed 2006-11-27 18:52 busa_ru * * upd: removed unused xa_wm_take_focus 2006-11-27 06:40 busa_ru * * fix: print fname and line number, improve portability 2006-11-27 06:38 busa_ru * * upd: raised debug levels for useless messages 2006-11-27 06:37 busa_ru * *** empty log message *** 2006-11-10 08:34 busa_ru * *** empty log message *** 2006-11-10 08:29 busa_ru * fix: correct implementation of focus proxy in xembed_init() fix: correct focus tracking in xembed_handle_event() fix: fix non-focusable icons detection (still broken, I think) upd: change interface to xembed_track_focus_change() upd: cleanup xembed_message() upd: misc cleanups 2006-11-10 08:11 busa_ru * fix: embed_kde_icons() cleaned up add: print type of WM_PROTOCOLS message in client_message() 2006-11-10 08:07 busa_ru * add: create targets for html and manpage add: create target for Changelog 2006-11-10 07:59 busa_ru * add: print_debug_header() now prints debug level of the message 2006-10-29 08:12 busa_ru * fix: xembed_{next,prev}_icon() now actually work fix: better focus handling in xembed_event() 2006-10-29 07:57 busa_ru * fix: dump_win_info(): check the property before trying to print its contents 2006-10-29 07:55 busa_ru * fix: check if the current xembed focused icon is non-NULL in the sigusr1 handler 2006-10-29 07:54 busa_ru * fix: struct TrayIcon: more consistent names for xembed-related fields 2006-10-29 07:52 busa_ru * *** empty log message *** 2006-10-26 12:32 busa_ru * *** empty log message *** 2006-10-26 12:30 busa_ru * upd: dump_win_info() now really works 2006-10-26 12:24 busa_ru * OUCH. Completely new files =) Reworked XEMBED interface. Still needs testing. 2006-10-26 12:20 busa_ru * fix: portability enchancements in ewmh_dump_window_states() 2006-10-26 12:19 busa_ru * add: struct XEMBEDData tray_data to TrayData add: ask WM for WM_TAKE focus for XEMBED 2006-10-26 12:15 busa_ru * upd: all XEMBED functionality is now provided by xembed.c 2006-10-26 12:14 busa_ru * fix: remove unneeded ';' in macro definitions 2006-10-26 12:08 busa_ru * add: new fields in struct TrayIcon: - supports_xembed : flag for xembed support - last_xembed_timestamp : the timestamp of last processed xmebed event - last_xembed_msgid : the id of last processed xembed event fix: stupid bugs in next_icon and prev_icon add: new function find_icon_ex() --- searches not only by window id, but also by mid-parent id upd: print_icon_data updated 2006-10-26 12:06 busa_ru * * use new xembed calls 2006-09-21 04:46 busa_ru * *** empty log message *** 2006-09-21 04:46 busa_ru * * remove 'permanent' option. now this is the default behaviour 2006-09-21 04:45 busa_ru * * focus change is now logged 2006-09-17 10:51 busa_ru * * fix new rc file behaviour concerning bool kw 2006-09-16 06:01 busa_ru * * added data structures to track internal XEMBED focus 2006-09-16 05:59 busa_ru * * fix compiler warning 2006-09-16 05:58 busa_ru * * remove dependency on GNU wordexp * make boolean rc file directives have _optional_ arguments 2006-09-16 05:54 busa_ru * * implement basic focus tracking and related XEMBED behaviour 2006-09-16 05:52 busa_ru * *** empty log message *** 2006-09-16 05:51 busa_ru * * correctly check for backtrace presence 2006-09-16 05:38 busa_ru * *** empty log message *** 2006-09-08 19:16 busa_ru * * fixed find_placement to accurately handle invalid placements 2006-09-08 19:13 busa_ru * *** empty log message *** 2006-09-05 14:47 busa_ru * * revert small temporary changes 2006-09-04 18:08 busa_ru * *** empty log message *** 2006-09-04 18:05 busa_ru * + check for libgen.h 2006-09-04 18:03 busa_ru * * enclosed macro definition in do {} while(0) 2006-09-04 18:02 busa_ru * * update macros for do {} while(0) * fix GNUish call to strftime in print_debug_header() 2006-09-04 18:01 busa_ru * * update macros: enclose them in do {} while(0) * update (un)embedding code to use wait_for_event(_serial) * revert embedding code to old behaviour: now icon is considered unembedding until there was a proper reparent notify * fix the bug with icon placement inside the mid-parent. now the icon is always moved to (0,0) when updating its position 2006-09-04 17:58 busa_ru * + new functions next_icon() and prev_icon() to walk along the list of icons in a circular way (for XEMBED focus) * increased debug level for restoring/purging/backuping icon list * slight modification for forall_icons_from(): now if tgt == NULL it starts from the head of the icon list * print_icon_data now also prints mapstate of the icon * comments in icons.h 2006-09-04 17:55 busa_ru * + comments in kde_tray.h * code cleanup in check_kde_tray_icons() 2006-09-04 17:53 busa_ru * + complete rework of layout engine: cleaner, more simple code. no x-related calls. 2006-09-04 17:49 busa_ru * + basic support for XEMBED focus (added focus_change() function) * fixed (un)embedding/resize handling functions to match new concept * updated (un)embedding code to match new embedding concept + basic supprt for collecting KDE icons on startup 2006-09-04 17:45 busa_ru * * enclosed macro definition in do {} while(0) 2006-09-04 17:43 busa_ru * * fixed basename bug: XPG version from libgen.h is now used * fixed initialization bug: now settings.full_pmt_search, settings.min_space_policy and settings.minimal_movement are initialized on startup + added comments to settings.h 2006-09-04 17:41 busa_ru * + added basic support for XEMBED focus changes (TrayData.xembed_current) + new tray_show() function * better selection handling (TrayData.old_sel_owner) + fixed tray growing bug 2006-09-04 17:37 busa_ru * * fixed prototypes for tray_set_mwm_hints() and mwm_set_hints() were added to wmh.h * small code cleanup for wmh.c 2006-09-04 17:33 busa_ru * + xembed_get_info() now returns XEMBED_ERROR if something goes wrong 2006-09-04 17:31 busa_ru * + new functions wait_for_event and wait_for_event_serial + new debug function dump_win_info 2006-06-11 17:01 busa_ru * *** empty log message *** 2006-06-11 15:46 busa_ru * * now works in non-debug mode * added USR1 handler to non-debug mode * really fixed geometry issues (TODO item #1) * tray.c cleaned up a bit * fixed some signed<->unsigned conversion compile time warnings * better embedding code (still needs more work) 2006-05-21 16:41 busa_ru * fix: provide correct gravity for tray`s window (TODO item 1) 2006-05-21 16:38 busa_ru * *** empty log message *** 2006-05-21 05:55 busa_ru * fix: set window gravity 2006-05-21 05:51 busa_ru * preliminary TODO for 0.5 is ready 2006-05-15 12:24 busa_ru * *** empty log message *** 2006-05-15 10:54 busa_ru * add: version bumped to 0.4 2006-05-15 08:53 busa_ru * fix: make sources c89 conformant 2006-05-14 12:56 busa_ru * *** empty log message *** 2006-05-07 14:56 busa_ru * fix: work around the absence of wordexp in netbsd 2006-05-07 08:02 busa_ru * fix: preliminary support for systems with/without backtrace/printstack 2006-05-05 12:31 busa_ru * fix: temporarily disable collection of kde icons on startup 2006-05-05 12:24 busa_ru * *** empty log message *** 2006-05-05 12:02 busa_ru * add: PORTING issues 2006-05-01 07:52 busa_ru * fix: DBG() reorganization fix: code cleanup 2006-04-30 12:39 busa_ru * fix: code and configure.in cleanup 2006-04-29 17:13 busa_ru * add: collect KDE/FDO-compatible icons at startup 2006-04-29 15:46 busa_ru * add: timestamping mechanism 2006-04-27 15:59 busa_ru * add: window layer add: update stalonertayrc.sample 2006-04-17 17:14 busa_ru * *** empty log message *** 2006-04-17 17:06 busa_ru * add: new cmdline/config params: sticky, skip_taskbar, no_title, no_borders and corresponding wmh support fix: get rid of forced_resize_list and friends 2006-04-17 17:02 busa_ru * *** empty log message *** 2006-04-15 08:37 busa_ru * *** empty log message *** 2006-04-15 08:33 busa_ru * fix: add dependency on fnmatch.h 2006-04-15 08:30 busa_ru * *** empty log message *** 2006-04-10 14:40 busa_ru * add: basic support for mwm and ewm hints 2006-03-29 06:49 busa_ru * fix: due to recent fix of geometry bug, the resize code is updated to work with any grow_gravity fix: atom variables must start with xa_ 2006-03-29 06:47 busa_ru * fix: sanitize max_width and max_height to be >= icon_size 2006-03-29 06:25 busa_ru * *** empty log message *** 2006-03-28 16:06 busa_ru * fix: typos (again :() 2006-03-28 13:52 busa_ru * fix: typos... 2006-03-28 13:27 busa_ru * fix: removed old news 2006-03-28 13:25 busa_ru * fix: now manpage and debian/ directory are distributed (with make dist) 2006-03-28 13:12 busa_ru * fix: make distcheck works now 2006-03-28 13:08 busa_ru * fix: now version is set to 0.3 2006-03-23 19:08 busa_ru * fix: typos 2006-03-23 06:48 busa_ru * fix: better tray`s geometry tracking (now tray_update_bg() works =) fix: some cleanup in tray_update_bg() 2006-03-19 14:41 busa_ru * fix: remove unused code 2006-03-19 14:38 busa_ru * fix: tray_update_bg() 2006-03-19 14:34 busa_ru * fix: typos, punctuation 2006-03-16 17:36 busa_ru * fix: memory-related fix in print_icon_data() 2006-03-16 17:22 busa_ru * add: more detailed output for print_icon_data() 2006-03-16 17:20 busa_ru * fix: use 22x22 default geometry for KDE tray icons 2006-03-16 16:10 busa_ru * fix: better description 2006-03-14 16:27 busa_ru * fix: current e-mail, better description and other misc fixes for release 2006-03-14 15:53 busa_ru * fix: misc typos in DBG calls 2006-03-14 15:32 busa_ru * fix:misc changes found with -Wall 2006-03-14 15:01 busa_ru * fix: better icon-resize support add: preliminary support (timestamping) for ewmh 2006-03-14 14:58 busa_ru * *** empty log message *** 2006-03-14 14:50 busa_ru * add: show_window() and hide_window() to show/hide icons 2006-03-14 14:45 busa_ru * add: show_window() and hide_window() to show/hide icon fix: source reogranized 2006-03-14 14:40 busa_ru * *** empty log message *** 2006-03-14 14:38 busa_ru * fix: layout_handle_icon_resize() fixes fix: make grid2window and recalc_grid_size ignore not-layed-out icons 2006-03-14 14:35 busa_ru * fix: make icons_backup(),icons_restore(),icons_purge_backup() actually work =) 2006-03-14 14:28 busa_ru * *** empty log message *** 2006-03-09 18:12 busa_ru * add: proper transparent bg support add: icon life cycle implementation as described in docs/ICON_LIFE_CYCLE add: reacquring tray selection support 2006-03-07 10:26 busa_ru * add: split sources for maintainability 2006-03-07 10:23 busa_ru * *** empty log message *** 2006-03-07 10:22 busa_ru * add: icon list backup/restore 2006-03-07 10:04 busa_ru * add: basic documentation 2006-03-07 05:37 busa_ru * add: split sources for maintainability 2006-02-26 05:37 busa_ru * fix: cleanup, optimizations add: root transparency implementation 2006-02-26 05:30 busa_ru * fix: cleanup fix: update sample rc file to be in sync with defaults, 2006-02-25 17:04 busa_ru * fix: cleanup, optimizations 2006-02-25 16:58 busa_ru * add: timestamps for debug output 2006-02-25 16:38 busa_ru * *** empty log message *** 2005-11-25 10:11 busa_ru * add: support for root-transparency 2005-11-25 10:07 busa_ru * fix: possible SIGSEGV 2005-11-25 10:05 busa_ru * fix: include proper headers for exit() 2005-11-25 09:09 busa_ru * *** empty log message *** 2005-08-04 15:53 busa_ru * fix: possible SIGSEGV in match_fixed_resize_list 2005-07-17 12:01 busa_ru * *** empty log message *** 2005-06-25 15:32 busa_ru * add: hint WM about min/max sizes and size increment step 2005-06-19 12:16 busa_ru * *** empty log message *** 2005-06-19 12:11 busa_ru * fix: transparent mid-parent is back 2005-06-19 12:09 busa_ru * tray.h 2005-06-19 12:08 busa_ru * add: grid recalculation after certain events 2005-06-17 07:08 busa_ru * fix: more last minute fixes 2005-06-17 06:46 busa_ru * fix: misc last minute fixes 2005-06-17 06:35 busa_ru * add: tray inteface header 2005-06-17 05:46 busa_ru * add: now update_icon_pos resizes parent if necessary 2005-06-17 05:41 busa_ru * add: basic support for icon resizing (layout_handle_icon_resize) add: very basic support for tray resizing (layout_update) fix: placement choosing cleanup (ip_leq) fix: misc. cleanups 2005-06-17 05:39 busa_ru * add: handlers for tray resize, icon resize, etc. add: improvements to grow code: enshure that the tray_data.xsh reflects the real tray geometry 2005-06-17 05:37 busa_ru * add: new member of settings struct: gravity_x, which holds the value of gravity in X11 notation 2005-06-17 05:30 busa_ru * add: forall_icons_from function fix: cmd and sort code cleanups 2005-06-17 05:22 busa_ru * add: -g cmd line param now causes icon to grow after some timeout 2005-06-17 05:21 busa_ru * add: new NEWS file for 0.2 release 2005-06-17 05:17 busa_ru * add: support for backtracing when debug is on 2005-04-11 14:01 busa_ru * fix: misc. debug info enchancements 2005-04-11 13:59 busa_ru * fix: fixed geometry parsing in interpret_settings() 2005-03-24 15:42 busa_ru * *** empty log message *** 2005-03-24 15:37 busa_ru * fix: use NO_NATIVE_KDE for kde icons support 2005-03-24 15:32 busa_ru * add: code cleanup --- simplified unembed_window() 2005-03-24 15:17 busa_ru * fix: fixed list cleanup code 2005-03-24 15:16 busa_ru * *** empty log message *** 2005-03-24 15:14 busa_ru * fix: fixed the --disable-kde configure flag. Now it works :) 2005-03-21 18:35 busa_ru * Changelog is now removed, because it's autogenerated Added to cvs following utils to ease trays' testing - tray-test-fdo is a simple freedesktop.org tray application - get_props shows all atoms assosiated with the given window 2005-03-21 18:18 busa_ru * fix: switched clean_icons() to use code from list.h add: print_icon_data() now gives better information 2005-03-21 18:14 busa_ru * fix: changed the logic: now mid-parent has _exactly_ the size of an icon (this fixes the problem, that icon was trying to move to (0,0) afterwards) add: added a macro CALC_INNER_POS to calculate mid-parent's pos in the grid rect 2005-03-21 18:06 busa_ru * fix: parse_bool() was using if (strcasemp()) instead if (!strcasecmp()) fix: moved interpret_settings() to interface part of settings.c and out of read_settings() fix: parse_geometry() now makes use of flags returned by XParseGeometry 2005-03-21 17:16 busa_ru * add: startup code from main() was splitted up to creat_tray_windos() and aquire_tray_selection(), to be easier to understand and mainain fix: embed_icon() cleanup code was wrong add: all atoms are now stored in tray_data 2005-03-21 17:11 busa_ru * *** empty log message *** 2005-03-21 17:09 busa_ru * fix: find_placement: icon, for which placement was to be found, was still considered as an obstacle. fix: layout_icon: add a fallback to 24x24 if icons size cannot be determined fix: layout_icon: fix a call to force_icon_size to appear an all execution flows 2005-03-21 15:58 busa_ru * *** empty log message *** 2005-03-21 15:56 busa_ru * fix: DIE now uses ERR to report a reason 2005-03-21 15:54 busa_ru * add: debug statements are enabled by default 2005-03-21 15:53 busa_ru * add: BUGS to list the current bug list add: more TODO items add: DESIGN-NOTES update 2005-03-18 19:45 busa_ru * fix: cleanup 2005-03-18 19:44 busa_ru * fix: proper debug levels for X events add: better signal handling add: traceback for sigsegv 2005-03-18 19:43 busa_ru * fix: insertion code add: cleanup code 2005-03-18 19:40 busa_ru * add: rewrite from ground up 2005-03-18 19:39 busa_ru * fix: dumb errors 2005-03-18 19:38 busa_ru * fix: better interface part add: mass operations interface 2005-03-18 19:37 busa_ru * fix: error handling code added fix: cleaups add: infrastructure to update icons pos on demand 2005-03-18 19:35 busa_ru * fix: include config.h add: ERR macro to unify error messages 2005-03-18 19:30 busa_ru * *** empty log message *** 2005-03-18 18:40 busa_ru * Now the support for kde tray icons can be enabled at compile time. 2004-09-27 13:44 busa_ru * *** empty log message *** 2004-09-22 14:53 busa_ru * *** empty log message *** 2004-09-17 18:15 busa_ru * *** empty log message *** 2004-07-31 19:15 busa_ru * added icon size monitoring 2004-07-31 09:49 busa_ru * Initial revision