2009-07-09
* Added support for $swapfree
+ * Improved Lua API (lua_read_parse has been removed in favour of the
+ conky_parse() Lua API call)
+ * Introduced new Lua Cairo and Imlib2 bindings
2009-07-08
* Fixed a couple memory-related bugs
SUBDIRS = \
src \
doc \
+ lua \
data
AUTOMAKE_OPTIONS = \
file_names["nano_syntax"] = "extras/nano/conky.nanorc"
file_names["variables"] = "doc/variables.xml"
file_names["config_settings"] = "doc/config_settings.xml"
+file_names["lua"] = "doc/lua.xml"
+file_names["docs"] = "doc/docs.xml"
+file_names["command_options"] = "doc/command_options.xml"
for fn in file_names.values():
if not os.path.exists(fn) or not os.path.isfile(fn):
tidy(file_names['variables'])
tidy(file_names['config_settings'])
+tidy(file_names['lua'])
+tidy(file_names['command_options'])
#
# Do all the objects first
AC_PROG_LD
AC_PROG_INSTALL
AC_PROG_LIBTOOL
+AM_PROG_LIBTOOL
AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
if test x"$HAVE_PKGCONFIG" = x"no"; then
doc/Makefile
src/Makefile
src/build.h
+ lua/Makefile
)
uname=`uname`
AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes -o x$want_audacious = xlegacy)
if test x$want_audacious = xyes; then
PKG_CHECK_MODULES([Audacious], [audacious >= 1.4.0 dbus-glib-1 glib-2.0 gobject-2.0])
- CFLAGS="$CFLAGS $Audacious_CFLAGS"
- LIBS="$LIBS $Audacious_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $Audacious_CFLAGS"
+ conky_LIBS="$conky_LIBS $Audacious_LIBS"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious"
AC_CHECK_HEADERS([audacious/audctrl.h audacious/dbus.h glib.h glib-object.h],
AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
else if test x$want_audacious = xlegacy; then
PKG_CHECK_MODULES([Audacious], [audacious < 1.4.0 glib-2.0])
- CFLAGS="$CFLAGS $Audacious_CFLAGS"
- LIBS="$LIBS $Audacious_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $Audacious_CFLAGS"
+ conky_LIBS="$conky_LIBS $Audacious_LIBS"
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious"
AC_CHECK_HEADERS([audacious/beepctrl.h glib.h], [], AC_MSG_ERROR([required header(s) not found]))
AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
if test x$want_bmpx = xyes; then
PKG_CHECK_MODULES([BMPx], [bmp-2.0 >= 0.14.0])
- CFLAGS="$CFLAGS $BMPx_CFLAGS"
- LIBS="$LIBS $BMPx_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $BMPx_CFLAGS"
+ conky_LIBS="$conky_LIBS $BMPx_LIBS"
AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
fi
AM_CONDITIONAL(BUILD_MATH, test x$want_math = xyes)
if test x$want_math = xyes; then
- LIBS="$LIBS -lm"
+ conky_LIBS="$conky_LIBS -lm"
AC_DEFINE(MATH, 1, [Define if you want math support])
fi
AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
if test x$want_xmms2 = xyes; then
PKG_CHECK_MODULES([XMMS2], [xmms2-client])
- CFLAGS="$CFLAGS $XMMS2_CFLAGS"
- LIBS="$LIBS $XMMS2_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $XMMS2_CFLAGS"
+ conky_LIBS="$conky_LIBS $XMMS2_LIBS"
AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
fi
if test x$want_eve = xyes; then
PKG_CHECK_MODULES([libxml2], libxml-2.0)
PKG_CHECK_MODULES([libcurl], libcurl)
- CFLAGS="$CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
- LIBS="$LIBS $libxml2_LIBS $libcurl_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
+ conky_LIBS="$conky_LIBS $libxml2_LIBS $libcurl_LIBS"
AC_DEFINE(EVE, 1, [Define if you want Eve-Online Skill monitor support])
AC_DEFINE(EVEURL_TRAINING, "http://api.eve-online.com/char/SkillInTraining.xml.aspx", [Eve training URL])
AC_DEFINE(EVEURL_SKILLTREE, "http://api.eve-online.com/eve/Skilltree.xml.aspx", [Eve skilltree URL])
WANT_GLIB=yes
PKG_CHECK_MODULES([libxml2], libxml-2.0)
PKG_CHECK_MODULES([libcurl], libcurl)
- CFLAGS="$CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
- LIBS="$LIBS $libxml2_LIBS $libcurl_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
+ conky_LIBS="$conky_LIBS $libxml2_LIBS $libcurl_LIBS"
AC_DEFINE(RSS, 1, [Define if you want rss support])
fi
if test x$want_weather = xyes; then
WANT_GLIB=yes
PKG_CHECK_MODULES([libcurl], libcurl)
- CFLAGS="$CFLAGS $libcurl_CFLAGS"
- LIBS="$LIBS $libcurl_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $libcurl_CFLAGS"
+ conky_LIBS="$conky_LIBS $libcurl_LIBS"
AC_DEFINE(WEATHER, 1, [Define if you want weather support])
fi
dnl
+dnl X11
+dnl
+
+AC_ARG_ENABLE([x11],
+ AC_HELP_STRING([--disable-x11], [disable if you do not want X11 support @<:@default=yes@:>@]),
+ [want_x11="$enableval"], [want_x11=yes])
+
+AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
+if test "x$want_x11" = "xyes"; then
+ if $PKG_CONFIG --exists x11; then
+ PKG_CHECK_MODULES([X11], [x11])
+ conky_CFLAGS="$conky_CFLAGS $X11_CFLAGS"
+ conky_LIBS="$conky_LIBS $X11_LIBS"
+ else
+ dnl non-modular X11 installations
+ AC_PATH_X
+ AC_PATH_XTRA
+ conky_CFLAGS="$conky_CFLAGS $X_CFLAGS"
+ conky_LIBS="$conky_LIBS $X_LIBS"
+ conky_LDFLAGS="$conky_LDFLAGS $conky_LIBS $X_PRE_LIBS"
+ if test "x$no_x" = "xyes"; then
+ AC_MSG_ERROR([Can't locate your X11 installation])
+ fi
+ AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
+ fi
+ AC_DEFINE(X11, 1, [Define if you want to use X11])
+fi
+
+dnl
+dnl IMLIB2
+dnl
+
+AC_ARG_ENABLE([imlib2],
+ AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support (also enables Lua Imlib2 support if lua-extras enabled) [[default=no]]]),
+ [want_imlib2="$enableval"], [want_imlib2=no])
+if test x$want_imlib2 = xyes; then
+ if test "x$want_x11" != "xyes"; then
+ dnl silently disable if no x11
+ want_imlib2=no
+ else
+ PKG_CHECK_MODULES([Imlib2], [imlib2])
+ conky_CFLAGS="$conky_CFLAGS $Imlib2_CFLAGS"
+ conky_LIBS="$conky_LIBS $Imlib2_LIBS"
+ AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
+ fi
+fi
+AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
+
+dnl
dnl Lua
dnl
AC_ARG_ENABLE([lua],
AC_HELP_STRING([--enable-lua], [enable if you want Lua scripting support @<:@default=yes@:>@]),
[want_lua="$enableval"], [want_lua=yes])
-#
+AC_ARG_ENABLE([lua-extras],
+ AC_HELP_STRING([--enable-lua-extras], [enable if you want to install Lua extras (including bindings) @<:@default=no@:>@]),
+ [want_lua_extras="$enableval"], [want_lua_extras=no])
+AC_ARG_ENABLE([lua-cairo],
+ AC_HELP_STRING([--enable-lua-cairo], [enable if you want Lua Cairo bindings for Conky (requires lua-extras enabled) @<:@default=no@:>@]),
+ [want_lua_cairo="$enableval"], [want_lua_cairo=no])
+
AM_CONDITIONAL(BUILD_LUA, test x$want_lua = xyes)
if test x$want_lua = xyes; then
PKG_CHECK_MODULES(LUA, lua >= 5.1, [ ],[
PKG_CHECK_MODULES(LUA51, lua5.1 >= 5.1)
])
])
- CFLAGS="$CFLAGS $LUA_CFLAGS $LUA51_CFLAGS"
- LIBS="$LIBS $LUA_LIBS $LUA51_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $LUA_CFLAGS $LUA51_CFLAGS"
+ conky_LIBS="$conky_LIBS $LUA_LIBS $LUA51_LIBS"
+
+ want_lua_imlib2="$want_imlib2"
+ if test x$want_lua_extras != xyes; then
+ want_lua_cairo=no
+ want_lua_imlib2=no
+ else
+ AC_CHECK_PROG(HAVE_TOLUAPP, tolua++, yes, no)
+ if test "x$want_x11" != "xyes"; then
+ dnl silently disable if no x11
+ want_lua_cairo=no
+ else
+ if test x$want_lua_cairo = xyes; then
+ PKG_CHECK_MODULES([cairo], cairo)
+ PKG_CHECK_MODULES([cairo_xlib], cairo-xlib)
+ if test x"$HAVE_TOLUAPP" = x"no"; then
+ AC_MSG_ERROR([tolua++ is required for Lua Cairo support.])
+ else
+ AC_CHECK_PROGS(toluapp, tolua++)
+ AC_DEFINE(HAVE_LUA_CAIRO, 1, [Define if you want Lua Cairo bindings for Conky])
+ fi
+ libcairo_CFLAGS="$libcairo_CFLAGS $cairo_CFLAGS $cairo_xlib_CFLAGS"
+ libcairo_LIBS="$libcairo_LIBS $cairo_LIBS $cairo_xlib_LIBS"
+ fi
+ if test x$want_imlib2 = xyes; then
+ if test x"$HAVE_TOLUAPP" = x"no"; then
+ AC_MSG_ERROR([tolua++ is required for Lua Imlib2 support.])
+ else
+ want_lua_imlib2=yes
+ AC_CHECK_PROGS(toluapp, tolua++)
+ AC_DEFINE(HAVE_LUA_IMLIB2, 1, [Define if you want Lua Imlib2 bindings for Conky])
+ fi
+ fi
+ fi
+ fi
+ AM_CONDITIONAL(BUILD_LUA_CAIRO, test x$want_lua_cairo = xyes)
+ AM_CONDITIONAL(BUILD_LUA_IMLIB2, test x$want_lua_imlib2 = xyes)
AC_DEFINE(HAVE_LUA, 1, [Define if you want Lua scripting support])
fi
AM_CONDITIONAL(BUILD_WLAN, test x$want_wlan = xyes)
if test x$want_wlan = xyes; then
AC_CHECK_HEADERS([iwlib.h], [], AC_MSG_ERROR([iwlib.h header not found]))
- AC_CHECK_LIB([iw], [iw_sockets_open], [LIBS="$LIBS -liw"], AC_MSG_ERROR([iw_sockets_open not found]))
+ AC_CHECK_LIB([iw], [iw_sockets_open], [conky_LIBS="$conky_LIBS -liw"], AC_MSG_ERROR([iw_sockets_open not found]))
AC_DEFINE(HAVE_IWLIB, 1, [Define if you want wireless support])
fi
if test "$am_cv_func_iconv" != yes; then
AC_MSG_WARN([Could not find libiconv])
else
- LIBS="$LIBS $LIBICONV"
+ conky_LIBS="$conky_LIBS $LIBICONV"
fi
dnl
-dnl X11
-dnl
-
-AC_ARG_ENABLE([x11],
- AC_HELP_STRING([--disable-x11], [disable if you do not want X11 support @<:@default=yes@:>@]),
- [want_x11="$enableval"], [want_x11=yes])
-
-AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
-if test "x$want_x11" = "xyes"; then
- if $PKG_CONFIG --exists x11; then
- PKG_CHECK_MODULES([X11], [x11])
- CFLAGS="$CFLAGS $X11_CFLAGS"
- LIBS="$LIBS $X11_LIBS"
- else
- dnl non-modular X11 installations
- AC_PATH_X
- AC_PATH_XTRA
- CFLAGS="$CFLAGS $X_CFLAGS"
- LIBS="$LIBS $X_LIBS"
- LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
- if test "x$no_x" = "xyes"; then
- AC_MSG_ERROR([Can't locate your X11 installation])
- fi
- AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
- fi
- AC_DEFINE(X11, 1, [Define if you want to use X11])
-fi
-
-
-dnl
dnl Xext Double-buffering Extension
dnl
else
if $PKG_CONFIG --exists xext; then
PKG_CHECK_MODULES([Xext],[xext])
- CFLAGS="$CFLAGS $Xext_CFLAGS"
- LIBS="$LIBS $Xext_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $Xext_CFLAGS"
+ conky_LIBS="$conky_LIBS $Xext_LIBS"
else
dnl non-modular X11 installation
- AC_CHECK_LIB([Xext], [XdbeQueryExtension], [LIBS="$LIBS -lXext"],
+ AC_CHECK_LIB([Xext], [XdbeQueryExtension], [conky_LIBS="$conky_LIBS -lXext"],
AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
fi
AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
else
if $PKG_CONFIG --exists xdamage; then
PKG_CHECK_MODULES([XDamage],[xdamage])
- CFLAGS="$CFLAGS $XDamage_CFLAGS"
- LIBS="$LIBS $XDamage_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $XDamage_CFLAGS"
+ conky_LIBS="$conky_LIBS $XDamage_LIBS"
else
dnl non-modular X11 installation
- AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [LIBS="$LIBS -lXdamage"],
+ AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [conky_LIBS="$conky_LIBS -lXdamage"],
AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
fi
AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
want_xft=no
else
PKG_CHECK_MODULES([Xft], [xft])
- CFLAGS="$CFLAGS $Xft_CFLAGS"
- LIBS="$LIBS $Xft_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $Xft_CFLAGS"
+ conky_LIBS="$conky_LIBS $Xft_LIBS"
AC_DEFINE(XFT, 1, [Define for Xft support])
fi
fi
dnl
-dnl IMLIB2
-dnl
-
-AC_ARG_ENABLE([imlib2],
- AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support [[default=no]]]),
- [want_imlib2="$enableval"], [want_imlib2=no])
-if test x$want_imlib2 = xyes; then
- if test "x$want_x11" != "xyes"; then
- dnl silently disable if no x11
- want_imlib2=no
- else
- PKG_CHECK_MODULES([Imlib2], [imlib2])
- CFLAGS="$CFLAGS $Imlib2_CFLAGS"
- LIBS="$LIBS $Imlib2_LIBS"
- AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
- fi
-fi
-AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
-
-dnl
dnl NVIDIA libXNVCtrl support
dnl
dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
dnl ## am I Stupid ??
dnl ## it won't find the lib for some reason!?
- LIBS="$LIBS -lXNVCtrl"
+ conky_LIBS="$conky_LIBS -lXNVCtrl"
AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
fi
fi
if test x$WANT_GLIB = xyes; then
PKG_CHECK_MODULES([GLib2], [glib-2.0])
- CFLAGS="$CFLAGS $GLib2_CFLAGS"
- LIBS="$LIBS $GLib2_LIBS"
+ conky_CFLAGS="$conky_CFLAGS $GLib2_CFLAGS"
+ conky_LIBS="$conky_LIBS $GLib2_LIBS"
fi
dnl
if test x$WANT_KVM = xyes; then
AC_CHECK_LIB(kvm, kvm_open,
- LIBS="$LIBS -lkvm",
+ conky_LIBS="$conky_LIBS -lkvm",
AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
)
fi
if test x$WANT_DEVSTAT = xyes; then
AC_CHECK_LIB(devstat, devstat_getversion,
- LIBS="$LIBS -ldevstat",
+ conky_LIBS="$conky_LIBS -ldevstat",
AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
)
fi
if test x$WANT_OSSLIB = xyes; then
AC_CHECK_LIB(ossaudio, _oss_ioctl,
- LIBS="$LIBS -lossaudio",
+ conky_LIBS="$conky_LIBS -lossaudio",
AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
)
fi
AC_CHECK_HEADER(alsa/asoundlib.h,, want_alsa=no)
fi
if test x$want_alsa = xyes; then
- AC_CHECK_LIB(asound, snd_pcm_open,LIBS="$LIBS -lasound", want_alsa=no)
+ AC_CHECK_LIB(asound, snd_pcm_open,conky_LIBS="$conky_LIBS -lasound", want_alsa=no)
fi
if test x$want_alsa = xyes; then
AC_DEFINE(MIXER_IS_ALSA, 1, [Define if the mixers use ALSA])
dnl check that the gcc version is >=4.3, if we're using gcc
if test ! "x$GCC" = "xyes" -o $gcc_major -ge 4 -a $gcc_minor -ge 3; then
AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])
- CFLAGS="$CFLAGS $OPENMP_CFLAGS"
+ conky_CFLAGS="$conky_CFLAGS $OPENMP_CFLAGS"
else
want_openmp=no
fi
if test x$dah = xyes; then
AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
- LDFLAGS="$LDFLAGS -lkstat"
+ conky_LDFLAGS="$conky_LDFLAGS -lkstat"
fi
fi
AC_MSG_CHECKING([if $LD accepts -O1])
case `$LD -O1 -v 2>&1 </dev/null` in
*GNU* | *BSD*)
- LDFLAGS="$LDFLAGS -Wl,-O1"
+ conky_LDFLAGS="$conky_LDFLAGS -Wl,-O1"
AC_MSG_RESULT([yes])
;;
*)
esac
dnl Solve multiple definitions (only necessary when gnulib is used)
-dnl LDFLAGS="$LDFLAGS -Xlinker -zmuldefs"
+dnl conky_LDFLAGS="$conky_LDFLAGS -Xlinker -zmuldefs"
dnl
dnl Da.
dnl
-CFLAGS="$CFLAGS -Wall -W"
+conky_CFLAGS="$conky_CFLAGS -Wall -W"
dnl
dnl debug
[want_debug="$enableval"], [want_debug=no])
if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
- CFLAGS="$CFLAGS -g3"
+ conky_CFLAGS="$conky_CFLAGS -g3"
AC_DEFINE([DEBUG], 1, [Define for debugging])
fi
if test "x$want_testing" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
if test "x$want_debug" = "xyes"; then
- CFLAGS="$CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
+ conky_CFLAGS="$conky_CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
else
- CFLAGS="$CFLAGS -g3 -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
+ conky_CFLAGS="$conky_CFLAGS -g3 -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
fi
fi
-AC_SUBST(CFLAGS)
+AC_SUBST(conky_CFLAGS)
+AC_SUBST(conky_LIBS)
AC_SUBST(X11_LIBS)
AC_OUTPUT
Installing into: $prefix
System config dir: $sysconfdir
- C compiler flags: $CFLAGS
- Linker flags: $LDFLAGS
- Libraries: $LIBS
+ C compiler flags: $conky_CFLAGS
+ Libraries: $conky_LIBS
+ Linker flags: $conky_LDFLAGS
* X11:
X11 support: $want_x11
hddtemp: $want_hddtemp
portmon: $want_portmon
RSS: $want_rss
- WEATHER: $want_weather
- Lua: $want_lua
+ Weather (METAR): $want_weather
wireless: $want_wlan
IBM: $want_ibm
nvidia: $want_nvidia
ALSA mixer: $want_alsa
apcupsd: $want_apcupsd
I/O stats: $want_iostats
+
+ * Lua ($want_lua) bindings:
+ Cairo: $want_lua_cairo
+ Imlib2: $want_lua_imlib2
+
EOF
rm -f conky.1
rm -f variables.html
rm -f config_settings.html
+ rm -f lua.html
-conky.1: command_options.xml config_settings.xml docs.xml variables.xml
+conky.1: command_options.xml config_settings.xml docs.xml variables.xml lua.xml
${db2x_xsltproc_cmd} -s man ${srcdir}/docs.xml -o docs.mxml
${db2x_manxml_cmd} docs.mxml
${xsltproc_cmd} http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl ${srcdir}/docs.xml > docs.html
mv README ${top_srcdir}
xsltproc ${srcdir}/variables.xsl ${srcdir}/variables.xml > variables.html
xsltproc ${srcdir}/config_settings.xsl ${srcdir}/config_settings.xml > config_settings.html
+ xsltproc ${srcdir}/lua.xsl ${srcdir}/lua.xml > lua.html
else
conky.1:
man_MANS = conky.1
-EXTRA_DIST = $(DOCS) command_options.xml config_settings.xml docgen.sh docs.xml variables.xml variables.xsl config_settings.xsl
+EXTRA_DIST = $(DOCS) command_options.xml config_settings.xml docgen.sh docs.xml variables.xml variables.xsl config_settings.xsl lua.xml lua.xsl
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
<variablelist>
- <varlistentry>
- <term><command><option>-v | -V | --version</option></command></term>
- <listitem>
- Prints version and exits
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-q | --quiet</option></command></term>
- <listitem>
- Run Conky in 'quiet mode' (ie. no output)
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-D | --debug</option></command></term>
- <listitem>
- Increase debugging output, ie. -DD for more debugging
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-a | --alignment=</option></command><option>ALIGNMENT</option></term>
- <listitem>
- Text alignment on screen, {top,bottom,middle}_{left,right,middle} or none. Can also be abbreviated with first chars of position, ie. tr for top_right.
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-b | --double-buffer</option></command></term>
- <listitem>
- Use double buffering (eliminates "flicker")
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-c | --config=</option></command><option>FILE</option></term>
- <listitem>
- Config file to load instead of $HOME/.conkyrc
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-C | --print-config</option></command></term>
- <listitem>
- Print builtin default config to stdout. See also the section EXAMPLES for more information.
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-d | --daemonize</option></command></term>
- <listitem>
- Daemonize Conky, aka fork to background
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-f | --font=</option></command><option>FONT</option></term>
- <listitem>
- Font to use
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-h | --help</option></command></term>
- <listitem>
- Prints command line help and exits
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-o | --own-window</option></command></term>
- <listitem>
- Create own window to draw
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-t | --text=</option></command><option>TEXT</option></term>
- <listitem>
- Text to render, remember single quotes, like -t ' $uptime '
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-u | --interval=</option></command><option>SECONDS</option></term>
- <listitem>
- Update interval
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-w | --window-id=</option></command><option>WIN_ID</option></term>
- <listitem>
- Window id to draw
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-X | --display=</option></command><option>DISPLAY</option></term>
- <listitem>
- X11 display to use
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-x </option></command><option>X_COORDINATE</option></term>
- <listitem>
- X position
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-y </option></command><option>Y_COORDINATE</option></term>
- <listitem>
- Y position
- <para></para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><command><option>-i </option></command><option>COUNT</option></term>
- <listitem>
- Number of times to update Conky (and quit)
- <para></para></listitem>
- </varlistentry>
-
+ <varlistentry>
+ <term>
+ <command>
+ <option>-v | -V | --version</option>
+ </command>
+ </term>
+ <listitem>Prints version and exits
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-q | --quiet</option>
+ </command>
+ </term>
+ <listitem>Run Conky in 'quiet mode' (ie. no output)
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-D | --debug</option>
+ </command>
+ </term>
+ <listitem>Increase debugging output, ie. -DD for more
+ debugging
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-a | --alignment=</option>
+ </command>
+ <option>ALIGNMENT</option>
+ </term>
+ <listitem>Text alignment on screen,
+ {top,bottom,middle}_{left,right,middle} or none. Can also
+ be abbreviated with first chars of position, ie. tr for
+ top_right.
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-b | --double-buffer</option>
+ </command>
+ </term>
+ <listitem>Use double buffering (eliminates "flicker")
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-c | --config=</option>
+ </command>
+ <option>FILE</option>
+ </term>
+ <listitem>Config file to load instead of $HOME/.conkyrc
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-C | --print-config</option>
+ </command>
+ </term>
+ <listitem>Print builtin default config to stdout. See also
+ the section EXAMPLES for more information.
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-d | --daemonize</option>
+ </command>
+ </term>
+ <listitem>Daemonize Conky, aka fork to background
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-f | --font=</option>
+ </command>
+ <option>FONT</option>
+ </term>
+ <listitem>Font to use
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-h | --help</option>
+ </command>
+ </term>
+ <listitem>Prints command line help and exits
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-o | --own-window</option>
+ </command>
+ </term>
+ <listitem>Create own window to draw
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-t | --text=</option>
+ </command>
+ <option>TEXT</option>
+ </term>
+ <listitem>Text to render, remember single quotes, like -t '
+ $uptime '
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-u | --interval=</option>
+ </command>
+ <option>SECONDS</option>
+ </term>
+ <listitem>Update interval
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-w | --window-id=</option>
+ </command>
+ <option>WIN_ID</option>
+ </term>
+ <listitem>Window id to draw
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-X | --display=</option>
+ </command>
+ <option>DISPLAY</option>
+ </term>
+ <listitem>X11 display to use
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-x</option>
+ </command>
+ <option>X_COORDINATE</option>
+ </term>
+ <listitem>X position
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-y</option>
+ </command>
+ <option>Y_COORDINATE</option>
+ </term>
+ <listitem>Y position
+ <para></para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>-i</option>
+ </command>
+ <option>COUNT</option>
+ </term>
+ <listitem>Number of times to update Conky (and quit)
+ <para></para></listitem>
+ </varlistentry>
</variablelist>
<varlistentry>
<term>
<command>
+ <option>lua_draw_hook_post</option>
+ </command>
+ <option>function_name [function arguments]</option>
+ </term>
+ <listitem>This function, if defined, will be called by
+ Conky through each iteration after drawing to the window.
+ Requires X support. Takes any number of optional arguments.
+
+ <para /></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>lua_draw_hook_pre</option>
+ </command>
+ <option>function_name [function arguments]</option>
+ </term>
+ <listitem>This function, if defined, will be called by
+ Conky through each iteration before drawing to the window.
+ Requires X support. Takes any number of optional arguments.
+
+ <para /></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
<option>lua_load</option>
</command>
</term>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <!--jtan325 created this-->
- <xsl:output method="html"/>
-
- <xsl:template match="/">
- <html>
- <head>
- <title>~/.conkyrc settings</title>
- </head>
- <body bgcolor="#FFFFFF">
- <xsl:apply-templates />
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="variablelist" >
- <table cellpadding="3">
-
- <tr bgcolor = "#eecfa1">
- <th>Variable</th>
- <th>Explanation</th>
- </tr>
-
- <xsl:for-each select="varlistentry">
+ version="1.0">
+
+ <xsl:output method="html"/>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>~/.conkyrc settings</title>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <xsl:apply-templates />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>Conky Variables</title>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <xsl:apply-templates />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>Lua API</title>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <xsl:apply-templates />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="member/command">
+ <strong>
+ <xsl:value-of select="." />
+ </strong>
+ </xsl:template>
+
+ <xsl:template match="member/option">
+ <xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="member">
+ <li>
+ <xsl:apply-templates />
+ </li>
+ </xsl:template>
+
+ <xsl:template match="simplelist">
+ <ul>
+ <xsl:apply-templates select="member" />
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="para">
+ <p>
+ <xsl:value-of select="." />
+ </p>
+ </xsl:template>
+
+ <xsl:template match="variablelist" >
+ <table cellpadding="3">
+
+ <tr bgcolor = "#eecfa1">
+ <th>Variable</th>
+ <th>Explanation</th>
+ </tr>
+
+ <xsl:for-each select="varlistentry">
<xsl:variable name="row_bg">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">#fffafa</xsl:when>
<xsl:otherwise>#b4cdcd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <tr bgcolor = "{$row_bg}">
- <td align="center">
- <xsl:value-of select="term/command/option" />
- </td>
- <td>
- <xsl:value-of select="listitem" />
- </td>
- </tr>
- </xsl:for-each>
- </table>
- </xsl:template>
+ <tr bgcolor = "{$row_bg}">
+ <td align="center">
+ <xsl:value-of select="term/command/option" />
+ </td>
+ <td>
+ <xsl:apply-templates select="listitem" />
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
</xsl:stylesheet>
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
-<!ENTITY testtable SYSTEM "test.xml">
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
+[
<!ENTITY command_options SYSTEM "command_options.xml">
<!ENTITY config_settings SYSTEM "config_settings.xml">
<!ENTITY variables SYSTEM "variables.xml">
+<!ENTITY lua SYSTEM "lua.xml">
]>
-
<refentry>
<refentryinfo>
<address>
<firstname>Brenden</firstname>
<surname>Matthews</surname>
</author>
- <date>2009-06-06</date>
+ <date>2009-07-09</date>
</refentryinfo>
-
<refmeta>
- <refentrytitle>conky</refentrytitle>
+ <refentrytitle>conky – Manual</refentrytitle>
<manvolnum>1</manvolnum>
</refmeta>
-
<refnamediv>
<refname>conky</refname>
- <refpurpose>A system monitor for X originally based on the torsmo code, but more kickass. It just keeps on given'er. Yeah.</refpurpose>
+ <refpurpose>A system monitor for X originally based on the
+ torsmo code, but more kickass. It just keeps on given'er.
+ Yeah.</refpurpose>
</refnamediv>
-
<refsynopsisdiv>
<cmdsynopsis>
<command>conky</command>
- <arg><replaceable>options</replaceable></arg>
+ <arg>
+ <replaceable>options</replaceable>
+ </arg>
</cmdsynopsis>
</refsynopsisdiv>
-
<refsect1>
<title>Description</title>
- <para>
- Conky is a system monitor for X originally based on torsmo.
- Since its inception, Conky has changed significantly from its predecessor, while maintaining
- simplicity and configurability. Conky can display just about anything, either
- on your root desktop or in its own window. Not only does Conky have many
- built-in objects, it can also display just about any piece of information by
+ <para>Conky is a system monitor for X originally based on
+ torsmo. Since its inception, Conky has changed
+ significantly from its predecessor, while maintaining
+ simplicity and configurability. Conky can display just
+ about anything, either on your root desktop or in its own
+ window. Not only does Conky have many built-in objects, it
+ can also display just about any piece of information by
using scripts and other external programs.
</para>
- <para>
- Conky has more than 250 built in objects, including support for
- a plethora of OS stats (uname, uptime, CPU usage, mem usage, disk
- usage, "top" like process stats, and network monitoring, just to name a few),
- built in IMAP and POP3 support, built in support for many popular
- music players (MPD, XMMS2, BMPx, Audacious), and much much more.
- Conky can display this info either as text, or using simple progress
- bars and graph widgets, with different fonts and colours.
- </para>
- <para>
- We are always looking for help, whether its reporting bugs, writing patches, or writing docs.
- Please use the facilities at SourceForge to make bug reports, feature requests, and submit patches,
- or stop by #conky on irc.freenode.net if you have questions or want to contribute.
+ <para>Conky has more than 250 built in objects, including
+ support for a plethora of OS stats (uname, uptime, CPU
+ usage, mem usage, disk usage, "top" like process stats, and
+ network monitoring, just to name a few), built in IMAP and
+ POP3 support, built in support for many popular music
+ players (MPD, XMMS2, BMPx, Audacious), and much much more.
+ Conky can display this info either as text, or using simple
+ progress bars and graph widgets, with different fonts and
+ colours.
</para>
- <para>
- Thanks for your interest in Conky.
+ <para>We are always looking for help, whether its reporting
+ bugs, writing patches, or writing docs. Please use the
+ facilities at SourceForge to make bug reports, feature
+ requests, and submit patches, or stop by #conky on
+ irc.freenode.net if you have questions or want to
+ contribute.</para>
+ <para>Thanks for your interest in Conky.
</para>
</refsect1>
-
<refsect1>
<title>Compiling</title>
- <para>
- For users compiling from source on a binary distro, make sure you have the X development
- libraries installed (Unless you provide configure with "--disable-x11"). This should be a
- package along the lines of "libx11-dev" or "xorg-x11-dev" for X11 libs, and similar "-dev"
- format for the other libs required (depending on your configure options). You should be able
- to see which extra packages you need to install by reading errors that you get from
+ <para>For users compiling from source on a binary distro,
+ make sure you have the X development libraries installed
+ (Unless you provide configure with "--disable-x11"). This
+ should be a package along the lines of "libx11-dev" or
+ "xorg-x11-dev" for X11 libs, and similar "-dev" format for
+ the other libs required (depending on your configure
+ options). You should be able to see which extra packages
+ you need to install by reading errors that you get from
'./configure'.
</para>
- <para>
- Conky has (for some time) been available in the repositories of most popular distributions.
- Here are some installation instructions for a few:
+ <para>Conky has (for some time) been available in the
+ repositories of most popular distributions. Here are some
+ installation instructions for a few:
</para>
- <para>
- Gentoo users -- Conky is in Gentoo's Portage... simply use "emerge app-admin/conky" for installation.
+ <para>Gentoo users -- Conky is in Gentoo's Portage...
+ simply use "emerge app-admin/conky" for
+ installation.
</para>
- <para>
- Debian, etc. users -- Conky should be in your repositories, and can be installed by doing
- "aptitude install conky".
+ <para>Debian, etc. users -- Conky should be in your
+ repositories, and can be installed by doing "aptitude
+ install conky".
</para>
- <para>
- Example to compile and run Conky with all optional components (note that some configure options may differ for your system):
+ <para>Example to compile and run Conky with all optional
+ components (note that some configure options may differ for
+ your system):
</para>
<variablelist>
<varlistentry>
<term>
- <command><option>sh autogen.sh</option></command> <option># Only required if building from the git repo</option>
+ <command>
+ <option>sh autogen.sh</option>
+ </command>
+ <option># Only required if building from the
+ git repo</option>
</term>
</varlistentry>
<varlistentry>
<term>
- <command><option>./configure </option></command><option>--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-own-window --enable-audacious[=yes|no|legacy] --enable-bmpx --disable-hddtemp --disable-mpd --enable-xmms2 --disable-portmon --disable-network --enable-debug --disable-x11 --disable-double-buffer --disable-xdamage --disable-xft</option>
+ <command>
+ <option>./configure</option>
+ </command>
+ <option>--prefix=/usr --mandir=/usr/share/man
+ --infodir=/usr/share/info --datadir=/usr/share
+ --sysconfdir=/etc --localstatedir=/var/lib
+ --disable-own-window
+ --enable-audacious[=yes|no|legacy]
+ --enable-bmpx --disable-hddtemp --disable-mpd
+ --enable-xmms2 --disable-portmon
+ --disable-network --enable-debug --disable-x11
+ --disable-double-buffer --disable-xdamage
+ --disable-xft</option>
</term>
</varlistentry>
<varlistentry>
<term>
- <command><option>make</option></command>
+ <command>
+ <option>make</option>
+ </command>
</term>
</varlistentry>
<varlistentry>
<term>
- <command><option>make install</option></command> <option># Optional</option>
+ <command>
+ <option>make install</option>
+ </command>
+ <option># Optional</option>
</term>
</varlistentry>
<varlistentry>
<term>
- <command><option>src/conky</option></command>
+ <command>
+ <option>src/conky</option>
+ </command>
</term>
</varlistentry>
</variablelist>
- <para>
- Conky has been tested to be compatible with C99 C, however it has not been tested
- with anything other than gcc, and is not guaranteed to work with other compilers.
- </para>
- <para>
-
+ <para>Conky has been tested to be compatible with C99 C,
+ however it has not been tested with anything other than
+ gcc, and is not guaranteed to work with other
+ compilers.
</para>
+ <para></para>
</refsect1>
-
-
-
<refsect1>
<title>You Should Know</title>
- <para>
- Conky is generally very good on resources. That said, the more you try to make Conky
- do, the more resources it is going to consume.
+ <para>Conky is generally very good on resources. That said,
+ the more you try to make Conky do, the more resources it is
+ going to consume.
</para>
- <para>
- An easy way to force Conky to reload your ~/.conkyrc: "killall -SIGUSR1 conky".
- Saves you the trouble of having to kill and then restart. You can now also do the same with SIGHUP.
+ <para>An easy way to force Conky to reload your ~/.conkyrc:
+ "killall -SIGUSR1 conky". Saves you the trouble of having
+ to kill and then restart. You can now also do the same with
+ SIGHUP.
</para>
</refsect1>
-
<refsect1>
<title>Options</title>
-
- <para>Command line options override configurations defined in configuration file.</para>
-
+ <para>Command line options override configurations defined in
+ configuration file.
+ </para>
&command_options;
-
</refsect1>
-
<refsect1>
<title>Configuration Settings</title>
-
- <para>
- Default configuration file location is $HOME/.conkyrc or
- ${sysconfdir}/conky/conky.conf. On most systems, sysconfdir is /etc,
- and you can find the sample config file there (/etc/conky/conky.conf).
+ <para>Default configuration file location is $HOME/.conkyrc or
+ ${sysconfdir}/conky/conky.conf. On most systems, sysconfdir is
+ /etc, and you can find the sample config file there
+ (/etc/conky/conky.conf).
</para>
- <para>
- You might want to copy it to $HOME/.conkyrc and then start modifying it.
- Other configs can be found at http://conky.sf.net/
+ <para>You might want to copy it to $HOME/.conkyrc and then
+ start modifying it. Other configs can be found at
+ http://conky.sf.net/
</para>
-
&config_settings;
</refsect1>
-
<refsect1>
<title>Variables</title>
-
- <para>
- Colors are parsed using XParsecolor(), there might be a list of them:
- /usr/share/X11/rgb.txt. Also, <ulink url="http://sedition.com/perl/rgb.html">
- http://sedition.com/perl/rgb.html</ulink>.
- Color can be also in #rrggbb format (hex).
+ <para>Colours are parsed using XParsecolor(), there might be a
+ list of them: /usr/share/X11/rgb.txt.
+ Colour can be also in
+ #rrggbb format (hex).
</para>
-
&variables;
</refsect1>
-
+ <refsect1>
+ <title>Lua API</title>
+ <para>Conky features a Lua Programming API, and also ships with
+ some Lua bindings for some useful libraries. Conky defines
+ certain global functions and variables which can be accessed
+ from Lua code running in Conky.
+ </para>
+ <para>To use Lua Conky, you first need to make sure you have a version of Conky
+ with Lua support enabled (``conky -v'' will report this). Scripts
+ must first be loaded using the lua_load configuration option. You
+ then call functions in Lua via Conky's $lua, $lua_read, and Lua
+ hooks.
+ </para>
+ <para>
+ At this time, the Lua API should not be considered stabe and may
+ change drastically from one release to another as it matures.
+ </para>
+ &lua;
+ </refsect1>
<refsect1>
<title>Examples</title>
<variablelist>
-
<varlistentry>
- <term><varname>conky </varname><option>-t '${time %D %H:%M}' -o -u 30</option></term>
- <listitem>Start Conky in its own window with date and clock as text and 30 sec update interval.</listitem>
+ <term>
+ <varname>conky</varname>
+ <option>-t '${time %D %H:%M}' -o -u 30</option>
+ </term>
+ <listitem>Start Conky in its own window with date
+ and clock as text and 30 sec update
+ interval.</listitem>
</varlistentry>
-
<varlistentry>
- <term><varname>conky </varname><option>-a top_left -x 5 -y 500 -d</option></term>
- <listitem>Start Conky to background at coordinates (5, 500).</listitem>
+ <term>
+ <varname>conky</varname>
+ <option>-a top_left -x 5 -y 500 -d</option>
+ </term>
+ <listitem>Start Conky to background at coordinates
+ (5, 500).</listitem>
</varlistentry>
-
<varlistentry>
- <term><varname>conky </varname><option>-C > ~/.conkyrc</option></term>
- <listitem>Do not start Conky, but have it output the builtin default config file to ~/.conkyrc for later customising.</listitem>
+ <term>
+ <varname>conky</varname>
+ <option>-C > ~/.conkyrc</option>
+ </term>
+ <listitem>Do not start Conky, but have it output
+ the builtin default config file to ~/.conkyrc for
+ later customising.</listitem>
</varlistentry>
-
</variablelist>
</refsect1>
-
<refsect1>
<title>Files</title>
<variablelist>
<varlistentry>
- <term><filename>${sysconfdir}/conky/conky.conf</filename></term>
- <listitem>Default system-wide configuration file. The value of ${sysconfdir} depends on the compile-time options (most likely /etc).</listitem>
+ <term>
+ <filename>
+ ${sysconfdir}/conky/conky.conf</filename>
+ </term>
+ <listitem>Default system-wide configuration file.
+ The value of ${sysconfdir} depends on the
+ compile-time options (most likely /etc).</listitem>
</varlistentry>
<varlistentry>
- <term><filename>~/.conkyrc</filename></term>
- <listitem>Default personal configuration file.</listitem>
+ <term>
+ <filename>~/.conkyrc</filename>
+ </term>
+ <listitem>Default personal configuration
+ file.</listitem>
</varlistentry>
</variablelist>
</refsect1>
-
<refsect1>
<title>Bugs</title>
- <para>
- Drawing to root or some other desktop window directly doesn't work with
- all window managers. Especially doesn't work well with Gnome and it has
- been reported that it doesn't work with KDE either. Nautilus can be
- disabled from drawing to desktop with program gconf-editor. Uncheck
- show_desktop in /apps/nautilus/preferences/. There is -w switch in Conky
- to set some specific window id. You might find xwininfo -tree useful to
- find the window to draw to. You can also use -o argument which makes
- Conky to create its own window. If you do try running Conky in its own
- window, be sure to read up on the own_window_type settings and experiment.
- </para>
+ <para>Drawing to root or some other desktop window directly
+ doesn't work with all window managers. Especially doesn't
+ work well with Gnome and it has been reported that it
+ doesn't work with KDE either. Nautilus can be disabled from
+ drawing to desktop with program gconf-editor. Uncheck
+ show_desktop in /apps/nautilus/preferences/. There is -w
+ switch in Conky to set some specific window id. You might
+ find xwininfo -tree useful to find the window to draw to.
+ You can also use -o argument which makes Conky to create
+ its own window. If you do try running Conky in its own
+ window, be sure to read up on the own_window_type settings
+ and experiment.</para>
</refsect1>
-
<refsect1>
<title>See Also</title>
- <para><ulink url="http://conky.sourceforge.net/">
- http://conky.sourceforge.net/</ulink></para>
- <para><ulink url="http://www.sourceforge.net/projects/conky">
- http://www.sourceforge.net/projects/conky</ulink></para>
- <para><ulink url="http://wiki.conky.be">
- http://wiki.conky.be</ulink></para>
<para>
- #conky on irc.freenode.net
+ <ulink url="http://conky.sourceforge.net/">
+ http://conky.sourceforge.net/</ulink>
</para>
+ <para>
+ <ulink url="http://www.sourceforge.net/projects/conky">
+ http://www.sourceforge.net/projects/conky</ulink>
+ </para>
+ <para>
+ <ulink url="http://wiki.conky.be">
+ http://wiki.conky.be</ulink>
+ </para>
+ <para>#conky on irc.freenode.net</para>
</refsect1>
-
<refsect1>
<title>Copying</title>
- <para>
- Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
- Any original torsmo code is licensed under the BSD license (see LICENSE.BSD for a copy).
- All code written since the fork of torsmo is licensed under the GPL (see LICENSE.GPL for a copy), except where noted differently (such as in portmon code, timed thread code, and audacious code which are LGPL, and prss which is an MIT-style license).
- </para>
+ <para>Copyright (c) 2005-2009 Brenden Matthews, Philip
+ Kovacs, et. al. Any original torsmo code is licensed under
+ the BSD license (see LICENSE.BSD for a copy). All code
+ written since the fork of torsmo is licensed under the GPL
+ (see LICENSE.GPL for a copy), except where noted
+ differently (such as in portmon code, timed thread code,
+ and audacious code which are LGPL, and prss which is an
+ MIT-style license).</para>
</refsect1>
<refsect1>
<title>Authors</title>
- <para>
- The Conky dev team (see AUTHORS for a full list of contributors).
- </para>
+ <para>The Conky dev team (see AUTHORS for a full list of
+ contributors).</para>
</refsect1>
</refentry>
--- /dev/null
+<variablelist>
+ <varlistentry>
+ <term>
+ <command>
+ <option>conky_parse(string)</option>
+ </command>
+ <option>function</option>
+ </term>
+ <listitem>
+ <para>This function takes a string that is evaluated as
+ per Conky's TEXT section, and then returns a string
+ with the result.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>conky_window</option>
+ </command>
+ <option>table</option>
+ </term>
+ <listitem>
+ <para>This table contains some information about
+ Conky's window. The following table describes the
+ values contained:</para>
+ <simplelist>
+ <member>
+ <command>drawable</command>
+ <option>- Window's drawable (Xlib
+ Drawable)</option>
+ </member>
+ <member>
+ <command>visual</command>
+ <option>- Window's visual (Xlib
+ Visual)</option>
+ </member>
+ <member>
+ <command>display</command>
+ <option>- Window's display (Xlib
+ Display)</option>
+ </member>
+ <member>
+ <command>width</command>
+ <option>- Window width (in pixels)</option>
+ </member>
+ <member>
+ <command>height</command>
+ <option>- Window height (in pixels)</option>
+ </member>
+ <member>
+ <command>border_inner_margin</command>
+ <option>- Window's inner border margin (in
+ pixels)</option>
+ </member>
+ <member>
+ <command>border_outer_margin</command>
+ <option>- Window's outer border margin (in
+ pixels)</option>
+ </member>
+ <member>
+ <command>border_width</command>
+ <option>- Window's border width (in
+ pixels)</option>
+ </member>
+ <member>
+ <command>text_start_x</command>
+ <option>- The x component of the starting
+ coordinate of text drawing</option>
+ </member>
+ <member>
+ <command>text_start_y</command>
+ <option>- The y component of the starting
+ coordinate of text drawing</option>
+ </member>
+ <member>
+ <command>text_width</command>
+ <option>- The width of the text drawing
+ region</option>
+ </member>
+ <member>
+ <command>text_height</command>
+ <option>- The height of the text drawing
+ region</option>
+ </member>
+ </simplelist>
+ <para>NOTE: This table is only defined when X support
+ is enabled.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>conky_build_info</option>
+ </command>
+ <option>string</option>
+ </term>
+ <listitem>
+ <para>A string containing the build info for this
+ particular instance of Conky, including the version,
+ build date, and architecture.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>conky_version</option>
+ </command>
+ <option>string</option>
+ </term>
+ <listitem>
+ <para>A string containing the version of the current
+ instance of Conky.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <command>
+ <option>conky_config</option>
+ </command>
+ <option>string</option>
+ </term>
+ <listitem>
+ <para>A string containing the path of the current Conky
+ configuration file.</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+ <xsl:output method="html"/>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>Lua API</title>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <xsl:apply-templates />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="member/command">
+ <strong>
+ <xsl:value-of select="." />
+ </strong>
+ </xsl:template>
+
+ <xsl:template match="member/option">
+ <xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="member">
+ <li>
+ <xsl:apply-templates />
+ </li>
+ </xsl:template>
+
+ <xsl:template match="simplelist">
+ <ul>
+ <xsl:apply-templates select="member" />
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="para">
+ <p>
+ <xsl:value-of select="." />
+ </p>
+ </xsl:template>
+
+ <xsl:template match="variablelist" >
+ <table cellpadding="3">
+
+ <tr bgcolor = "#eecfa1">
+ <th>Name</th>
+ <th>Type</th>
+ <th>Details</th>
+ </tr>
+
+ <xsl:for-each select="varlistentry">
+ <xsl:variable name="row_bg">
+ <xsl:choose>
+ <xsl:when test="position() mod 2 = 1">#fffafa</xsl:when>
+ <xsl:otherwise>#b4cdcd</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <tr bgcolor = "{$row_bg}">
+ <td align="center">
+ <xsl:value-of select="term/command/option" />
+ </td>
+ <td align="center">
+ <xsl:value-of select="term/option" />
+ </td>
+ <td>
+ <xsl:apply-templates select="listitem" />
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+</xsl:stylesheet>
default_graph_size config setting. Takes the switch '-t' to
use a temperature gradient, which makes the gradient values
change depending on the amplitude of a particular graph
- value (try it and see). If -t or -l is your first argument, you may need to preceed it by a space (' ').
+ value (try it and see). If -t or -l is your first argument,
+ you may need to preceed it by a space (' ').
<para /></listitem>
</varlistentry>
<varlistentry>
<option>interval (-t) (-l) command</option>
</term>
<listitem>Same as execgraph, but takes an interval arg and
- graphs values. If -t or -l is your first argument, you may need to preceed it by a space (' ').
+ graphs values. If -t or -l is your first argument, you may
+ need to preceed it by a space (' ').
<para /></listitem>
</varlistentry>
<varlistentry>
position (or any other formatting) of images, they are just
rendered as per the arguments passed. The only reason
$image is part of the TEXT section, is to allow for runtime
- modifications, through $execp $lua_parse, $lua_read_parse,
- or some other method.
+ modifications, through $execp $lua_parse, or some other
+ method.
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>loadavg</option>
</command>
- <option>(1|2|3)
- </option>
+ <option>(1|2|3)</option>
</term>
- <listitem>System load average, 1 is for past 1
- minute, 2 for past 5 minutes and 3 for past 15 minutes.
+ <listitem>System load average, 1 is for past 1 minute, 2
+ for past 5 minutes and 3 for past 15 minutes.
<para /></listitem>
</varlistentry>
<varlistentry>
<command>
<option>loadgraph</option>
</command>
- <option>(1|2|3) (height),(width) (gradient colour 1) (gradient
- colour 2) (scale) (-t) (-l)</option>
+ <option>(1|2|3) (height),(width) (gradient colour 1)
+ (gradient colour 2) (scale) (-t) (-l)</option>
</term>
<listitem>Load1 average graph, similar to xload, with
optional colours in hex, minus the #. Uses a logarithmic
<command>
<option>lua_read_parse</option>
</command>
- <option>function_name (conky text)</option>
+ <option />
</term>
- <listitem>Executes a Lua function per $lua, except takes a
- 2nd argument which is first evaluated as per Conky's TEXT
- section and passed to the function first. The return value
- is then parsed and prints the result value as per the
- syntax for Conky's TEXT section. See also 'lua_load' on how
- to load scripts.
+ <listitem>This function is deprecated. Please use the
+ conky_parse() Lua function instead.
<para /></listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term>
<command>
- <option>swapfree</option>
+ <option>swapbar</option>
</command>
+ <option>(height),(width)</option>
</term>
- <listitem>Amount of free swap
+ <listitem>Bar that shows amount of swap in use
<para /></listitem>
</varlistentry>
<varlistentry>
<term>
<command>
- <option>swapbar</option>
+ <option>swapfree</option>
</command>
- <option>(height),(width)</option>
</term>
- <listitem>Bar that shows amount of swap in use
+ <listitem>Amount of free swap
<para /></listitem>
</varlistentry>
<varlistentry>
</term>
<listitem>Download, parse and display METAR data from the
NWS. icao must be a valid icao for the required location
- (see for instance https://pilotweb.nas.faa.gov/qryhtml/icao/).
- data_type must be one of the following: last_update
- (display the date (yyyy/mm/dd) and time (UTC) of the last
- update), temperature_C (display air temperature in degree
- Celsius), temperature_F (display air temperature in degree
+ (see for instance
+ https://pilotweb.nas.faa.gov/qryhtml/icao/). data_type must
+ be one of the following: last_update (display the date
+ (yyyy/mm/dd) and time (UTC) of the last update),
+ temperature_C (display air temperature in degree Celsius),
+ temperature_F (display air temperature in degree
Fahrenheit), cloud_cover (display the highest cloud cover
status), pressure (display air pressure in millibar),
- wind_speed (display wind speed in km/hour), wind_dir (display
- wind direction), wind_dir_DEG (display compass wind direction),
- humidity (display relative humidity in %), weather (display
- any relevant weather event (rain, snow, etc.)).
- delay_in_minutes (optional, default 30) cannot be lower than
- 30 min. Up to 3 stations can be simultaneously queried. Note
- that this feature is still EXPERIMENTAL.
+ wind_speed (display wind speed in km/hour), wind_dir
+ (display wind direction), wind_dir_DEG (display compass
+ wind direction), humidity (display relative humidity in %),
+ weather (display any relevant weather event (rain, snow,
+ etc.)). delay_in_minutes (optional, default 30) cannot be
+ lower than 30 min. Up to 3 stations can be simultaneously
+ queried. Note that this feature is still EXPERIMENTAL.
<para /></listitem>
</varlistentry>
<varlistentry>
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- version="1.0">
-
- <!--jtan325 created this-->
- <xsl:output method="html"/>
-
- <xsl:template match="/">
- <html>
- <head>
- <title>Conky Variables</title>
- </head>
- <body bgcolor="#FFFFFF">
- <xsl:apply-templates />
- </body>
- </html>
- </xsl:template>
-
- <xsl:template match="variablelist" >
- <table cellpadding="3">
-
- <tr bgcolor = "#eecfa1">
- <th>Variable</th>
- <th>Arguments () = optional</th>
- <th>Explanation</th>
- </tr>
-
- <xsl:for-each select="varlistentry">
+ version="1.0">
+
+ <xsl:output method="html"/>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>Conky Variables</title>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <xsl:apply-templates />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>Lua API</title>
+ </head>
+ <body bgcolor="#FFFFFF">
+ <xsl:apply-templates />
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="member/command">
+ <strong>
+ <xsl:value-of select="." />
+ </strong>
+ </xsl:template>
+
+ <xsl:template match="member/option">
+ <xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="member">
+ <li>
+ <xsl:apply-templates />
+ </li>
+ </xsl:template>
+
+ <xsl:template match="simplelist">
+ <ul>
+ <xsl:apply-templates select="member" />
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="para">
+ <p>
+ <xsl:value-of select="." />
+ </p>
+ </xsl:template>
+
+ <xsl:template match="variablelist" >
+ <table cellpadding="3">
+
+ <tr bgcolor = "#eecfa1">
+ <th>Variable</th>
+ <th>Arguments () = optional</th>
+ <th>Explanation</th>
+ </tr>
+
+ <xsl:for-each select="varlistentry">
<xsl:variable name="row_bg">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">#fffafa</xsl:when>
<xsl:otherwise>#b4cdcd</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <tr bgcolor = "{$row_bg}">
- <td align="center">
- <xsl:value-of select="term/command/option" />
- </td>
- <td align="center">
- <xsl:value-of select="term/option" />
- </td>
- <td>
- <xsl:value-of select="listitem" />
- </td>
- </tr>
- </xsl:for-each>
- </table>
- </xsl:template>
+ <tr bgcolor = "{$row_bg}">
+ <td align="center">
+ <xsl:value-of select="term/command/option" />
+ </td>
+ <td align="center">
+ <xsl:value-of select="term/option" />
+ </td>
+ <td>
+ <xsl:apply-templates select="listitem" />
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
</xsl:stylesheet>
syntax "conky" "(\.*conkyrc.*$|conky.conf)"
## Configuration items
-color green "\<(alias|alignment|append_file|background|border_inner_margin|border_margin|border_outer_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|colorN|cpu_avg_samples|default_bar_size|default_color|default_gauge_size|default_graph_size|default_outline_color|default_shade_color|diskio_avg_samples|display|double_buffer|draw_borders|draw_graph_borders|draw_outline|draw_shades|font|format_human_readable|gap_x|gap_y|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_load|mail_spool|max_port_monitor_connections|max_specials|max_user_text|maximum_width|minimum_size|mpd_host|mpd_password|mpd_port|music_player_interval|net_avg_samples|no_buffers|out_to_console|out_to_stderr|out_to_x|override_utf8_locale|overwrite_file|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|sensor_device|short_units|show_graph_range|show_graph_scale|stippled_borders|temperature_unit|template|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|text|text_buffer_size|top_cpu_separate|top_name_width|total_run_times|update_interval|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>"
+color green "\<(alias|alignment|append_file|background|border_inner_margin|border_margin|border_outer_margin|border_width|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|colorN|cpu_avg_samples|default_bar_size|default_color|default_gauge_size|default_graph_size|default_outline_color|default_shade_color|diskio_avg_samples|display|double_buffer|draw_borders|draw_graph_borders|draw_outline|draw_shades|font|format_human_readable|gap_x|gap_y|if_up_strictness|imap|imlib_cache_flush_interval|imlib_cache_size|lua_draw_hook_post|lua_draw_hook_pre|lua_load|mail_spool|max_port_monitor_connections|max_specials|max_user_text|maximum_width|minimum_size|mpd_host|mpd_password|mpd_port|music_player_interval|net_avg_samples|no_buffers|out_to_console|out_to_stderr|out_to_x|override_utf8_locale|overwrite_file|own_window|own_window_class|own_window_colour|own_window_hints|own_window_title|own_window_transparent|own_window_type|pad_percents|pop3|sensor_device|short_units|show_graph_range|show_graph_scale|stippled_borders|temperature_unit|template|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|text|text_buffer_size|top_cpu_separate|top_name_width|total_run_times|update_interval|uppercase|use_spacer|use_xft|xftalpha|xftfont)\>"
## Configuration item constants
color yellow "\<(above|below|bottom_left|bottom_right|bottom_middle|desktop|dock|no|none|normal|override|skip_pager|skip_taskbar|sticky|top_left|top_right|top_middle|middle_left|middle_right|undecorated|yes)\>"
## Variables
-color brightblue "\<(acpiacadapter|acpifan|acpitemp|addr|addrs|adt746xcpu|adt746xfan|alignc|alignr|apcupsd|apcupsd_cable|apcupsd_charge|apcupsd_lastxfer|apcupsd_linev|apcupsd_load|apcupsd_loadbar|apcupsd_loadgauge|apcupsd_loadgraph|apcupsd_model|apcupsd_name|apcupsd_status|apcupsd_temp|apcupsd_timeleft|apcupsd_upsmode|apm_adapter|apm_battery_life|apm_battery_time|audacious_bar|audacious_bitrate|audacious_channels|audacious_filename|audacious_frequency|audacious_length|audacious_length_seconds|audacious_main_volume|audacious_playlist_length|audacious_playlist_position|audacious_position|audacious_position_seconds|audacious_status|audacious_title|battery|battery_bar|battery_percent|battery_short|battery_time|blink|bmpx_album|bmpx_artist|bmpx_bitrate|bmpx_title|bmpx_track|bmpx_uri|buffers|cached|color|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|combine|conky_build_arch|conky_build_date|conky_version|cpu|cpubar|cpugauge|cpugraph|disk_protect|diskio|diskio_read|diskio_write|diskiograph|diskiograph_read|diskiograph_write|downspeed|downspeedf|downspeedgraph|draft_mails|else|endif|entropy_avail|entropy_bar|entropy_perc|entropy_poolsize|eval|eve|exec|execbar|execgauge|execgraph|execi|execibar|execigauge|execigraph|execp|execpi|flagged_mails|font|forwarded_mails|freq|freq_g|fs_bar|fs_bar_free|fs_free|fs_free_perc|fs_size|fs_type|fs_used|fs_used_perc|goto|gw_iface|gw_ip|hddtemp|head|hr|hwmon|i2c|i8k_ac_status|i8k_bios|i8k_buttons_status|i8k_cpu_temp|i8k_left_fan_rpm|i8k_left_fan_status|i8k_right_fan_rpm|i8k_right_fan_status|i8k_serial|i8k_version|ibm_brightness|ibm_fan|ibm_temps|ibm_volume|iconv_start|iconv_stop|if_empty|if_existing|if_gw|if_match|if_mixer_mute|if_mounted|if_mpd_playing|if_running|if_smapi_bat_installed|if_up|if_updatenr|if_xmms2_connected|image|imap_messages|imap_unseen|ioscheduler|kernel|laptop_mode|lines|loadavg|loadgraph|lua|lua_bar|lua_gauge|lua_graph|lua_parse|lua_read_parse|machine|mails|mboxscan|mem|membar|memeasyfree|memfree|memgauge|memgraph|memmax|memperc|mixer|mixerbar|mixerl|mixerlbar|mixerr|mixerrbar|moc_album|moc_artist|moc_bitrate|moc_curtime|moc_file|moc_rate|moc_song|moc_state|moc_timeleft|moc_title|moc_totaltime|monitor|monitor_number|mpd_album|mpd_artist|mpd_bar|mpd_bitrate|mpd_elapsed|mpd_file|mpd_length|mpd_name|mpd_percent|mpd_random|mpd_repeat|mpd_smart|mpd_status|mpd_title|mpd_track|mpd_vol|nameserver|new_mails|nodename|nvidia|obsd_product|obsd_sensors_fan|obsd_sensors_temp|obsd_sensors_volt|obsd_vendor|offset|outlinecolor|pb_battery|platform|pop3_unseen|pop3_used|pre_exec|processes|read_tcp|replied_mails|rss|running_processes|scroll|seen_mails|shadecolor|smapi|smapi_bat_bar|smapi_bat_perc|smapi_bat_power|smapi_bat_temp|sony_fanspeed|stippled_hr|swap|swapfree|swapbar|swapmax|swapperc|sysname|tab|tail|tcp_portmon|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|texeci|time|to_bytes|top|top_io|top_mem|top_time|totaldown|totalup|trashed_mails|tztime|unflagged_mails|unforwarded_mails|unreplied_mails|unseen_mails|updates|upspeed|upspeedf|upspeedgraph|uptime|uptime_short|user_names|user_number|user_terms|user_times|utime|voffset|voltage_mv|voltage_v|weather|wireless_ap|wireless_bitrate|wireless_essid|wireless_link_bar|wireless_link_qual|wireless_link_qual_max|wireless_link_qual_perc|wireless_mode|words|xmms2_album|xmms2_artist|xmms2_bar|xmms2_bitrate|xmms2_comment|xmms2_date|xmms2_duration|xmms2_elapsed|xmms2_genre|xmms2_id|xmms2_percent|xmms2_playlist|xmms2_size|xmms2_smart|xmms2_status|xmms2_timesplayed|xmms2_title|xmms2_tracknr|xmms2_url)\>"
+color brightblue "\<(acpiacadapter|acpifan|acpitemp|addr|addrs|adt746xcpu|adt746xfan|alignc|alignr|apcupsd|apcupsd_cable|apcupsd_charge|apcupsd_lastxfer|apcupsd_linev|apcupsd_load|apcupsd_loadbar|apcupsd_loadgauge|apcupsd_loadgraph|apcupsd_model|apcupsd_name|apcupsd_status|apcupsd_temp|apcupsd_timeleft|apcupsd_upsmode|apm_adapter|apm_battery_life|apm_battery_time|audacious_bar|audacious_bitrate|audacious_channels|audacious_filename|audacious_frequency|audacious_length|audacious_length_seconds|audacious_main_volume|audacious_playlist_length|audacious_playlist_position|audacious_position|audacious_position_seconds|audacious_status|audacious_title|battery|battery_bar|battery_percent|battery_short|battery_time|blink|bmpx_album|bmpx_artist|bmpx_bitrate|bmpx_title|bmpx_track|bmpx_uri|buffers|cached|color|color0|color1|color2|color3|color4|color5|color6|color7|color8|color9|combine|conky_build_arch|conky_build_date|conky_version|cpu|cpubar|cpugauge|cpugraph|disk_protect|diskio|diskio_read|diskio_write|diskiograph|diskiograph_read|diskiograph_write|downspeed|downspeedf|downspeedgraph|draft_mails|else|endif|entropy_avail|entropy_bar|entropy_perc|entropy_poolsize|eval|eve|exec|execbar|execgauge|execgraph|execi|execibar|execigauge|execigraph|execp|execpi|flagged_mails|font|forwarded_mails|freq|freq_g|fs_bar|fs_bar_free|fs_free|fs_free_perc|fs_size|fs_type|fs_used|fs_used_perc|goto|gw_iface|gw_ip|hddtemp|head|hr|hwmon|i2c|i8k_ac_status|i8k_bios|i8k_buttons_status|i8k_cpu_temp|i8k_left_fan_rpm|i8k_left_fan_status|i8k_right_fan_rpm|i8k_right_fan_status|i8k_serial|i8k_version|ibm_brightness|ibm_fan|ibm_temps|ibm_volume|iconv_start|iconv_stop|if_empty|if_existing|if_gw|if_match|if_mixer_mute|if_mounted|if_mpd_playing|if_running|if_smapi_bat_installed|if_up|if_updatenr|if_xmms2_connected|image|imap_messages|imap_unseen|ioscheduler|kernel|laptop_mode|lines|loadavg|loadgraph|lua|lua_bar|lua_gauge|lua_graph|lua_parse|machine|mails|mboxscan|mem|membar|memeasyfree|memfree|memgauge|memgraph|memmax|memperc|mixer|mixerbar|mixerl|mixerlbar|mixerr|mixerrbar|moc_album|moc_artist|moc_bitrate|moc_curtime|moc_file|moc_rate|moc_song|moc_state|moc_timeleft|moc_title|moc_totaltime|monitor|monitor_number|mpd_album|mpd_artist|mpd_bar|mpd_bitrate|mpd_elapsed|mpd_file|mpd_length|mpd_name|mpd_percent|mpd_random|mpd_repeat|mpd_smart|mpd_status|mpd_title|mpd_track|mpd_vol|nameserver|new_mails|nodename|nvidia|obsd_product|obsd_sensors_fan|obsd_sensors_temp|obsd_sensors_volt|obsd_vendor|offset|outlinecolor|pb_battery|platform|pop3_unseen|pop3_used|pre_exec|processes|read_tcp|replied_mails|rss|running_processes|scroll|seen_mails|shadecolor|smapi|smapi_bat_bar|smapi_bat_perc|smapi_bat_power|smapi_bat_temp|sony_fanspeed|stippled_hr|swap|swapbar|swapfree|swapmax|swapperc|sysname|tab|tail|tcp_portmon|template0|template1|template2|template3|template4|template5|template6|template7|template8|template9|texeci|time|to_bytes|top|top_io|top_mem|top_time|totaldown|totalup|trashed_mails|tztime|unflagged_mails|unforwarded_mails|unreplied_mails|unseen_mails|updates|upspeed|upspeedf|upspeedgraph|uptime|uptime_short|user_names|user_number|user_terms|user_times|utime|voffset|voltage_mv|voltage_v|weather|wireless_ap|wireless_bitrate|wireless_essid|wireless_link_bar|wireless_link_qual|wireless_link_qual_max|wireless_link_qual_perc|wireless_mode|words|xmms2_album|xmms2_artist|xmms2_bar|xmms2_bitrate|xmms2_comment|xmms2_date|xmms2_duration|xmms2_elapsed|xmms2_genre|xmms2_id|xmms2_percent|xmms2_playlist|xmms2_size|xmms2_smart|xmms2_status|xmms2_timesplayed|xmms2_title|xmms2_tracknr|xmms2_url)\>"
color brightblue "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color cyan "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
syn region ConkyrcComment start=/^\s*#/ end=/$/
-syn keyword ConkyrcSetting alias alignment append_file background border_inner_margin border_margin border_outer_margin border_width color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 colorN cpu_avg_samples default_bar_size default_color default_gauge_size default_graph_size default_outline_color default_shade_color diskio_avg_samples display double_buffer draw_borders draw_graph_borders draw_outline draw_shades font format_human_readable gap_x gap_y if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_load mail_spool max_port_monitor_connections max_specials max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval net_avg_samples no_buffers out_to_console out_to_stderr out_to_x override_utf8_locale overwrite_file own_window own_window_class own_window_colour own_window_hints own_window_title own_window_transparent own_window_type pad_percents pop3 sensor_device short_units show_graph_range show_graph_scale stippled_borders temperature_unit template template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 text text_buffer_size top_cpu_separate top_name_width total_run_times update_interval uppercase use_spacer use_xft xftalpha xftfont
+syn keyword ConkyrcSetting alias alignment append_file background border_inner_margin border_margin border_outer_margin border_width color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 colorN cpu_avg_samples default_bar_size default_color default_gauge_size default_graph_size default_outline_color default_shade_color diskio_avg_samples display double_buffer draw_borders draw_graph_borders draw_outline draw_shades font format_human_readable gap_x gap_y if_up_strictness imap imlib_cache_flush_interval imlib_cache_size lua_draw_hook_post lua_draw_hook_pre lua_load mail_spool max_port_monitor_connections max_specials max_user_text maximum_width minimum_size mpd_host mpd_password mpd_port music_player_interval net_avg_samples no_buffers out_to_console out_to_stderr out_to_x override_utf8_locale overwrite_file own_window own_window_class own_window_colour own_window_hints own_window_title own_window_transparent own_window_type pad_percents pop3 sensor_device short_units show_graph_range show_graph_scale stippled_borders temperature_unit template template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 text text_buffer_size top_cpu_separate top_name_width total_run_times update_interval uppercase use_spacer use_xft xftalpha xftfont
syn keyword ConkyrcConstant
\ above
syn match ConkyrcVarStuff /{\@<=/ms=s contained nextgroup=ConkyrcVarName
-syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipwhite acpiacadapter acpifan acpitemp addr addrs adt746xcpu adt746xfan alignc alignr apcupsd apcupsd_cable apcupsd_charge apcupsd_lastxfer apcupsd_linev apcupsd_load apcupsd_loadbar apcupsd_loadgauge apcupsd_loadgraph apcupsd_model apcupsd_name apcupsd_status apcupsd_temp apcupsd_timeleft apcupsd_upsmode apm_adapter apm_battery_life apm_battery_time audacious_bar audacious_bitrate audacious_channels audacious_filename audacious_frequency audacious_length audacious_length_seconds audacious_main_volume audacious_playlist_length audacious_playlist_position audacious_position audacious_position_seconds audacious_status audacious_title battery battery_bar battery_percent battery_short battery_time blink bmpx_album bmpx_artist bmpx_bitrate bmpx_title bmpx_track bmpx_uri buffers cached color color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 combine conky_build_arch conky_build_date conky_version cpu cpubar cpugauge cpugraph disk_protect diskio diskio_read diskio_write diskiograph diskiograph_read diskiograph_write downspeed downspeedf downspeedgraph draft_mails else endif entropy_avail entropy_bar entropy_perc entropy_poolsize eval eve exec execbar execgauge execgraph execi execibar execigauge execigraph execp execpi flagged_mails font forwarded_mails freq freq_g fs_bar fs_bar_free fs_free fs_free_perc fs_size fs_type fs_used fs_used_perc goto gw_iface gw_ip hddtemp head hr hwmon i2c i8k_ac_status i8k_bios i8k_buttons_status i8k_cpu_temp i8k_left_fan_rpm i8k_left_fan_status i8k_right_fan_rpm i8k_right_fan_status i8k_serial i8k_version ibm_brightness ibm_fan ibm_temps ibm_volume iconv_start iconv_stop if_empty if_existing if_gw if_match if_mixer_mute if_mounted if_mpd_playing if_running if_smapi_bat_installed if_up if_updatenr if_xmms2_connected image imap_messages imap_unseen ioscheduler kernel laptop_mode lines loadavg loadgraph lua lua_bar lua_gauge lua_graph lua_parse lua_read_parse machine mails mboxscan mem membar memeasyfree memfree memgauge memgraph memmax memperc mixer mixerbar mixerl mixerlbar mixerr mixerrbar moc_album moc_artist moc_bitrate moc_curtime moc_file moc_rate moc_song moc_state moc_timeleft moc_title moc_totaltime monitor monitor_number mpd_album mpd_artist mpd_bar mpd_bitrate mpd_elapsed mpd_file mpd_length mpd_name mpd_percent mpd_random mpd_repeat mpd_smart mpd_status mpd_title mpd_track mpd_vol nameserver new_mails nodename nvidia obsd_product obsd_sensors_fan obsd_sensors_temp obsd_sensors_volt obsd_vendor offset outlinecolor pb_battery platform pop3_unseen pop3_used pre_exec processes read_tcp replied_mails rss running_processes scroll seen_mails shadecolor smapi smapi_bat_bar smapi_bat_perc smapi_bat_power smapi_bat_temp sony_fanspeed stippled_hr swap swapfree swapbar swapmax swapperc sysname tab tail tcp_portmon template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 texeci time to_bytes top top_io top_mem top_time totaldown totalup trashed_mails tztime unflagged_mails unforwarded_mails unreplied_mails unseen_mails updates upspeed upspeedf upspeedgraph uptime uptime_short user_names user_number user_terms user_times utime voffset voltage_mv voltage_v weather wireless_ap wireless_bitrate wireless_essid wireless_link_bar wireless_link_qual wireless_link_qual_max wireless_link_qual_perc wireless_mode words xmms2_album xmms2_artist xmms2_bar xmms2_bitrate xmms2_comment xmms2_date xmms2_duration xmms2_elapsed xmms2_genre xmms2_id xmms2_percent xmms2_playlist xmms2_size xmms2_smart xmms2_status xmms2_timesplayed xmms2_title xmms2_tracknr xmms2_url
+syn keyword ConkyrcVarName contained nextgroup=ConkyrcNumber,ConkyrcColour skipwhite acpiacadapter acpifan acpitemp addr addrs adt746xcpu adt746xfan alignc alignr apcupsd apcupsd_cable apcupsd_charge apcupsd_lastxfer apcupsd_linev apcupsd_load apcupsd_loadbar apcupsd_loadgauge apcupsd_loadgraph apcupsd_model apcupsd_name apcupsd_status apcupsd_temp apcupsd_timeleft apcupsd_upsmode apm_adapter apm_battery_life apm_battery_time audacious_bar audacious_bitrate audacious_channels audacious_filename audacious_frequency audacious_length audacious_length_seconds audacious_main_volume audacious_playlist_length audacious_playlist_position audacious_position audacious_position_seconds audacious_status audacious_title battery battery_bar battery_percent battery_short battery_time blink bmpx_album bmpx_artist bmpx_bitrate bmpx_title bmpx_track bmpx_uri buffers cached color color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 combine conky_build_arch conky_build_date conky_version cpu cpubar cpugauge cpugraph disk_protect diskio diskio_read diskio_write diskiograph diskiograph_read diskiograph_write downspeed downspeedf downspeedgraph draft_mails else endif entropy_avail entropy_bar entropy_perc entropy_poolsize eval eve exec execbar execgauge execgraph execi execibar execigauge execigraph execp execpi flagged_mails font forwarded_mails freq freq_g fs_bar fs_bar_free fs_free fs_free_perc fs_size fs_type fs_used fs_used_perc goto gw_iface gw_ip hddtemp head hr hwmon i2c i8k_ac_status i8k_bios i8k_buttons_status i8k_cpu_temp i8k_left_fan_rpm i8k_left_fan_status i8k_right_fan_rpm i8k_right_fan_status i8k_serial i8k_version ibm_brightness ibm_fan ibm_temps ibm_volume iconv_start iconv_stop if_empty if_existing if_gw if_match if_mixer_mute if_mounted if_mpd_playing if_running if_smapi_bat_installed if_up if_updatenr if_xmms2_connected image imap_messages imap_unseen ioscheduler kernel laptop_mode lines loadavg loadgraph lua lua_bar lua_gauge lua_graph lua_parse machine mails mboxscan mem membar memeasyfree memfree memgauge memgraph memmax memperc mixer mixerbar mixerl mixerlbar mixerr mixerrbar moc_album moc_artist moc_bitrate moc_curtime moc_file moc_rate moc_song moc_state moc_timeleft moc_title moc_totaltime monitor monitor_number mpd_album mpd_artist mpd_bar mpd_bitrate mpd_elapsed mpd_file mpd_length mpd_name mpd_percent mpd_random mpd_repeat mpd_smart mpd_status mpd_title mpd_track mpd_vol nameserver new_mails nodename nvidia obsd_product obsd_sensors_fan obsd_sensors_temp obsd_sensors_volt obsd_vendor offset outlinecolor pb_battery platform pop3_unseen pop3_used pre_exec processes read_tcp replied_mails rss running_processes scroll seen_mails shadecolor smapi smapi_bat_bar smapi_bat_perc smapi_bat_power smapi_bat_temp sony_fanspeed stippled_hr swap swapbar swapfree swapmax swapperc sysname tab tail tcp_portmon template0 template1 template2 template3 template4 template5 template6 template7 template8 template9 texeci time to_bytes top top_io top_mem top_time totaldown totalup trashed_mails tztime unflagged_mails unforwarded_mails unreplied_mails unseen_mails updates upspeed upspeedf upspeedgraph uptime uptime_short user_names user_number user_terms user_times utime voffset voltage_mv voltage_v weather wireless_ap wireless_bitrate wireless_essid wireless_link_bar wireless_link_qual wireless_link_qual_max wireless_link_qual_perc wireless_mode words xmms2_album xmms2_artist xmms2_bar xmms2_bitrate xmms2_comment xmms2_date xmms2_duration xmms2_elapsed xmms2_genre xmms2_id xmms2_percent xmms2_playlist xmms2_size xmms2_smart xmms2_status xmms2_timesplayed xmms2_title xmms2_tracknr xmms2_url
hi def link ConkyrcComment Comment
hi def link ConkyrcSetting Keyword
--- /dev/null
+# Conky, a system monitor, based on torsmo
+#
+# Please see COPYING for details
+#
+# Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. (see AUTHORS)
+# All rights reserved.
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+#
+
+libimlib2_la_SOURCES = imlib2.c
+libcairo_la_SOURCES = cairo.c
+
+clean-am: clean-generic mostlyclean-am
+ rm -f $(libimlib2_la_SOURCES)
+ rm -f $(libcairo_la_SOURCES)
+ rm -f *.la *.so
+
+if BUILD_LUA
+
+if BUILD_LUA_CAIRO
+libcairo = libcairo.la
+
+libcairo_la_CFLAGS = $(cairo_CFLAGS) $(cairo_xlib_CFLAGS)
+libcairo_la_LIBADD = $(cairo_LIBS) $(cairo_xlib_LIBS) -ltolua++
+
+cairo.c: cairo.pkg
+ ${toluapp} -n cairo -o cairo.c cairo.pkg
+
+endif # BUILD_LUA_CAIRO
+
+if BUILD_LUA_IMLIB2
+
+libimlib2 = libimlib2.la
+
+libimlib2_la_CFLAGS = $(Imlib2_CFLAGS)
+libimlib2_la_LIBADD = $(Imlib2_LIBS) -ltolua++
+
+imlib2.c: imlib2.pkg
+ ${toluapp} -n imlib2 -o imlib2.c imlib2.pkg
+
+endif # BUILD_LUA_IMLIB2
+pkglib_LTLIBRARIES = $(libcairo) $(libimlib2)
+
+endif # BUILD_LUA
+
--- /dev/null
+$#include <cairo-features.h>
+$#include <cairo-deprecated.h>
+$#include <cairo.h>
+$#include <cairo-xlib.h>
+$#include <X11/Xlib.h>
+/*
+ * This code was mostly copied from cairo.h and cairo-xlib.h with comments
+ * removed. The licence noticed below is present for the sake of clarity.
+ */
+
+/* cairo - a vector graphics library with display and print output
+ *
+ * Copyright © 2002 University of Southern California
+ * Copyright © 2005 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it either under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
+ * notice, a recipient may use your version of this file under either
+ * the MPL or the LGPL.
+ *
+ * You should have received a copy of the LGPL along with this library
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the MPL along with this library
+ * in the file COPYING-MPL-1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
+ * the specific language governing rights and limitations.
+ *
+ * The Original Code is the cairo graphics library.
+ *
+ * The Initial Developer of the Original Code is University of Southern
+ * California.
+ *
+ * Contributor(s):
+ * Carl D. Worth <cworth@cworth.org>
+ */
+
+typedef enum _cairo_antialias {
+ CAIRO_ANTIALIAS_DEFAULT,
+ CAIRO_ANTIALIAS_NONE,
+ CAIRO_ANTIALIAS_GRAY,
+ CAIRO_ANTIALIAS_SUBPIXEL
+} cairo_antialias_t;
+
+typedef struct _cairo_matrix {
+ double xx;
+ double yx;
+ double xy;
+ double yy;
+ double x0;
+ double y0;
+} cairo_matrix_t;
+typedef int cairo_bool_t;
+
+typedef struct _cairo cairo_t;
+
+typedef struct _cairo_surface cairo_surface_t;
+
+typedef struct _cairo_pattern cairo_pattern_t;
+
+
+typedef struct _cairo_user_data_key {
+ int unused;
+} cairo_user_data_key_t;
+
+typedef enum _cairo_status {
+ CAIRO_STATUS_SUCCESS = 0,
+ CAIRO_STATUS_NO_MEMORY,
+ CAIRO_STATUS_INVALID_RESTORE,
+ CAIRO_STATUS_INVALID_POP_GROUP,
+ CAIRO_STATUS_NO_CURRENT_POINT,
+ CAIRO_STATUS_INVALID_MATRIX,
+ CAIRO_STATUS_INVALID_STATUS,
+ CAIRO_STATUS_NULL_POINTER,
+ CAIRO_STATUS_INVALID_STRING,
+ CAIRO_STATUS_INVALID_PATH_DATA,
+ CAIRO_STATUS_READ_ERROR,
+ CAIRO_STATUS_WRITE_ERROR,
+ CAIRO_STATUS_SURFACE_FINISHED,
+ CAIRO_STATUS_SURFACE_TYPE_MISMATCH,
+ CAIRO_STATUS_PATTERN_TYPE_MISMATCH,
+ CAIRO_STATUS_INVALID_CONTENT,
+ CAIRO_STATUS_INVALID_FORMAT,
+ CAIRO_STATUS_INVALID_VISUAL,
+ CAIRO_STATUS_FILE_NOT_FOUND,
+ CAIRO_STATUS_INVALID_DASH,
+ CAIRO_STATUS_INVALID_DSC_COMMENT,
+ CAIRO_STATUS_INVALID_INDEX,
+ CAIRO_STATUS_CLIP_NOT_REPRESENTABLE,
+ CAIRO_STATUS_TEMP_FILE_ERROR,
+ CAIRO_STATUS_INVALID_STRIDE,
+ CAIRO_STATUS_FONT_TYPE_MISMATCH,
+ CAIRO_STATUS_USER_FONT_IMMUTABLE,
+ CAIRO_STATUS_USER_FONT_ERROR,
+ CAIRO_STATUS_NEGATIVE_COUNT,
+ CAIRO_STATUS_INVALID_CLUSTERS,
+ CAIRO_STATUS_INVALID_SLANT,
+ CAIRO_STATUS_INVALID_WEIGHT
+} cairo_status_t;
+
+typedef enum _cairo_content {
+ CAIRO_CONTENT_COLOR = 0x1000,
+ CAIRO_CONTENT_ALPHA = 0x2000,
+ CAIRO_CONTENT_COLOR_ALPHA = 0x3000
+} cairo_content_t;
+
+typedef enum _cairo_operator {
+ CAIRO_OPERATOR_CLEAR,
+
+ CAIRO_OPERATOR_SOURCE,
+ CAIRO_OPERATOR_OVER,
+ CAIRO_OPERATOR_IN,
+ CAIRO_OPERATOR_OUT,
+ CAIRO_OPERATOR_ATOP,
+
+ CAIRO_OPERATOR_DEST,
+ CAIRO_OPERATOR_DEST_OVER,
+ CAIRO_OPERATOR_DEST_IN,
+ CAIRO_OPERATOR_DEST_OUT,
+ CAIRO_OPERATOR_DEST_ATOP,
+
+ CAIRO_OPERATOR_XOR,
+ CAIRO_OPERATOR_ADD,
+ CAIRO_OPERATOR_SATURATE
+} cairo_operator_t;
+
+typedef enum _cairo_filter {
+ CAIRO_FILTER_FAST,
+ CAIRO_FILTER_GOOD,
+ CAIRO_FILTER_BEST,
+ CAIRO_FILTER_NEAREST,
+ CAIRO_FILTER_BILINEAR,
+ CAIRO_FILTER_GAUSSIAN
+} cairo_filter_t;
+
+cairo_surface_t *cairo_xlib_surface_create(Display * dpy,
+ Drawable drawable,
+ Visual * visual, int width, int height);
+
+cairo_surface_t *cairo_xlib_surface_create_for_bitmap(Display * dpy,
+ Pixmap bitmap,
+ Screen * screen, int width, int height);
+
+void cairo_xlib_surface_set_size(cairo_surface_t * surface, int width, int height);
+
+void cairo_xlib_surface_set_drawable(cairo_surface_t * surface, Drawable
+ drawable, int width, int height);
+
+Display *cairo_xlib_surface_get_display(cairo_surface_t * surface);
+
+Drawable cairo_xlib_surface_get_drawable(cairo_surface_t * surface);
+
+Screen *cairo_xlib_surface_get_screen(cairo_surface_t * surface);
+
+Visual *cairo_xlib_surface_get_visual(cairo_surface_t * surface);
+
+int cairo_xlib_surface_get_depth(cairo_surface_t * surface);
+
+int cairo_xlib_surface_get_width(cairo_surface_t * surface);
+
+int cairo_xlib_surface_get_height(cairo_surface_t * surface);
+
+int cairo_version(void);
+
+const char *cairo_version_string(void);
+
+cairo_t *cairo_create(cairo_surface_t * target);
+
+cairo_t *cairo_reference(cairo_t * cr);
+
+void cairo_destroy(cairo_t * cr);
+
+unsigned int cairo_get_reference_count(cairo_t * cr);
+
+void *cairo_get_user_data(cairo_t * cr, const cairo_user_data_key_t * key);
+
+cairo_status_t cairo_set_user_data(cairo_t * cr, const cairo_user_data_key_t *
+ key, void *user_data, cairo_destroy_func_t destroy);
+
+void cairo_save(cairo_t * cr);
+
+void cairo_restore(cairo_t * cr);
+
+void cairo_push_group(cairo_t * cr);
+
+void cairo_push_group_with_content(cairo_t * cr, cairo_content_t content);
+
+cairo_pattern_t *cairo_pop_group(cairo_t * cr);
+
+void cairo_pop_group_to_source(cairo_t * cr);
+
+void cairo_set_operator(cairo_t * cr, cairo_operator_t op);
+
+void cairo_set_source(cairo_t * cr, cairo_pattern_t * source);
+
+void cairo_set_source_rgb(cairo_t * cr, double red, double green, double blue);
+
+void cairo_set_source_rgba(cairo_t * cr, double red, double green, double blue, double alpha);
+
+void cairo_set_source_surface(cairo_t * cr, cairo_surface_t * surface, double x, double y);
+
+void cairo_set_tolerance(cairo_t * cr, double tolerance);
+
+void cairo_set_antialias(cairo_t * cr, cairo_antialias_t antialias);
+
+typedef enum _cairo_fill_rule {
+ CAIRO_FILL_RULE_WINDING,
+ CAIRO_FILL_RULE_EVEN_ODD
+} cairo_fill_rule_t;
+
+void cairo_set_fill_rule(cairo_t * cr, cairo_fill_rule_t fill_rule);
+
+void cairo_set_line_width(cairo_t * cr, double width);
+
+typedef enum _cairo_line_cap {
+ CAIRO_LINE_CAP_BUTT,
+ CAIRO_LINE_CAP_ROUND,
+ CAIRO_LINE_CAP_SQUARE
+} cairo_line_cap_t;
+
+void cairo_set_line_cap(cairo_t * cr, cairo_line_cap_t line_cap);
+
+typedef enum _cairo_line_join {
+ CAIRO_LINE_JOIN_MITER,
+ CAIRO_LINE_JOIN_ROUND,
+ CAIRO_LINE_JOIN_BEVEL
+} cairo_line_join_t;
+
+void cairo_set_line_join(cairo_t * cr, cairo_line_join_t line_join);
+
+void cairo_set_dash(cairo_t * cr, const double *dashes, int num_dashes, double offset);
+
+void cairo_set_miter_limit(cairo_t * cr, double limit);
+
+void cairo_translate(cairo_t * cr, double tx, double ty);
+
+void cairo_scale(cairo_t * cr, double sx, double sy);
+
+void cairo_rotate(cairo_t * cr, double angle);
+
+void cairo_transform(cairo_t * cr, cairo_matrix_t * matrix);
+
+void cairo_set_matrix(cairo_t * cr, cairo_matrix_t * matrix);
+
+void cairo_identity_matrix(cairo_t * cr);
+
+void cairo_user_to_device(cairo_t * cr, double *x, double *y);
+
+void cairo_user_to_device_distance(cairo_t * cr, double *dx, double *dy);
+
+void cairo_device_to_user(cairo_t * cr, double *x, double *y);
+
+void cairo_device_to_user_distance(cairo_t * cr, double *dx, double *dy);
+
+void cairo_new_path(cairo_t * cr);
+
+void cairo_move_to(cairo_t * cr, double x, double y);
+
+void cairo_new_sub_path(cairo_t * cr);
+
+void cairo_line_to(cairo_t * cr, double x, double y);
+
+void cairo_curve_to(cairo_t * cr, double x1, double y1, double x2, double y2, double x3, double y3);
+
+void cairo_arc(cairo_t * cr, double xc, double yc, double radius, double angle1, double angle2);
+
+void cairo_arc_negative(cairo_t * cr, double xc, double yc, double radius,
+ double angle1, double angle2);
+
+void cairo_rel_move_to(cairo_t * cr, double dx, double dy);
+
+void cairo_rel_line_to(cairo_t * cr, double dx, double dy);
+
+void cairo_rel_curve_to(cairo_t * cr, double dx1, double dy1, double dx2,
+ double dy2, double dx3, double dy3);
+
+void cairo_rectangle(cairo_t * cr, double x, double y, double width, double height);
+
+void cairo_close_path(cairo_t * cr);
+
+void cairo_path_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2);
+
+void cairo_paint(cairo_t * cr);
+
+void cairo_paint_with_alpha(cairo_t * cr, double alpha);
+
+void cairo_mask(cairo_t * cr, cairo_pattern_t * pattern);
+
+void cairo_mask_surface(cairo_t * cr, cairo_surface_t * surface, double
+ surface_x, double surface_y);
+
+void cairo_stroke(cairo_t * cr);
+
+void cairo_stroke_preserve(cairo_t * cr);
+
+void cairo_fill(cairo_t * cr);
+
+void cairo_fill_preserve(cairo_t * cr);
+
+void cairo_copy_page(cairo_t * cr);
+
+void cairo_show_page(cairo_t * cr);
+
+cairo_bool_t cairo_in_stroke(cairo_t * cr, double x, double y);
+
+cairo_bool_t cairo_in_fill(cairo_t * cr, double x, double y);
+
+void cairo_stroke_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2);
+
+void cairo_fill_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2);
+
+void cairo_reset_clip(cairo_t * cr);
+
+void cairo_clip(cairo_t * cr);
+
+void cairo_clip_preserve(cairo_t * cr);
+
+void cairo_clip_extents(cairo_t * cr, double *x1, double *y1, double *x2, double *y2);
+
+typedef struct _cairo_rectangle {
+ double x, y, width, height;
+} cairo_rectangle_t;
+
+typedef struct _cairo_rectangle_list {
+ cairo_status_t status;
+ cairo_rectangle_t *rectangles;
+ int num_rectangles;
+} cairo_rectangle_list_t;
+
+cairo_rectangle_list_t *cairo_copy_clip_rectangle_list(cairo_t * cr);
+
+void cairo_rectangle_list_destroy(cairo_rectangle_list_t * rectangle_list);
+
+typedef struct _cairo_scaled_font cairo_scaled_font_t;
+
+typedef struct _cairo_font_face cairo_font_face_t;
+
+typedef struct {
+ unsigned long index;
+ double x;
+ double y;
+} cairo_glyph_t;
+
+cairo_glyph_t *cairo_glyph_allocate(int num_glyphs);
+
+void cairo_glyph_free(cairo_glyph_t * glyphs);
+
+typedef struct {
+ int num_bytes;
+ int num_glyphs;
+} cairo_text_cluster_t;
+
+cairo_text_cluster_t *cairo_text_cluster_allocate(int num_clusters);
+
+void cairo_text_cluster_free(cairo_text_cluster_t * clusters);
+
+typedef enum _cairo_text_cluster_flags {
+ CAIRO_TEXT_CLUSTER_FLAG_BACKWARD = 0x00000001
+} cairo_text_cluster_flags_t;
+
+typedef struct {
+ double x_bearing;
+ double y_bearing;
+ double width;
+ double height;
+ double x_advance;
+ double y_advance;
+} cairo_text_extents_t;
+
+typedef struct {
+ double ascent;
+ double descent;
+ double height;
+ double max_x_advance;
+ double max_y_advance;
+} cairo_font_extents_t;
+
+typedef enum _cairo_font_slant {
+ CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_SLANT_ITALIC,
+ CAIRO_FONT_SLANT_OBLIQUE
+} cairo_font_slant_t;
+
+typedef enum _cairo_font_weight {
+ CAIRO_FONT_WEIGHT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD
+} cairo_font_weight_t;
+
+typedef enum _cairo_subpixel_order {
+ CAIRO_SUBPIXEL_ORDER_DEFAULT,
+ CAIRO_SUBPIXEL_ORDER_RGB,
+ CAIRO_SUBPIXEL_ORDER_BGR,
+ CAIRO_SUBPIXEL_ORDER_VRGB,
+ CAIRO_SUBPIXEL_ORDER_VBGR
+} cairo_subpixel_order_t;
+
+typedef enum _cairo_hint_style {
+ CAIRO_HINT_STYLE_DEFAULT,
+ CAIRO_HINT_STYLE_NONE,
+ CAIRO_HINT_STYLE_SLIGHT,
+ CAIRO_HINT_STYLE_MEDIUM,
+ CAIRO_HINT_STYLE_FULL
+} cairo_hint_style_t;
+
+typedef enum _cairo_hint_metrics {
+ CAIRO_HINT_METRICS_DEFAULT,
+ CAIRO_HINT_METRICS_OFF,
+ CAIRO_HINT_METRICS_ON
+} cairo_hint_metrics_t;
+
+typedef struct _cairo_font_options cairo_font_options_t;
+
+cairo_font_options_t *cairo_font_options_create(void);
+
+cairo_font_options_t *cairo_font_options_copy(cairo_font_options_t * original);
+
+void cairo_font_options_destroy(cairo_font_options_t * options);
+
+cairo_status_t cairo_font_options_status(cairo_font_options_t * options);
+
+void cairo_font_options_merge(cairo_font_options_t * options, cairo_font_options_t * other);
+
+cairo_bool_t cairo_font_options_equal(cairo_font_options_t * options,
+ cairo_font_options_t * other);
+
+unsigned long cairo_font_options_hash(cairo_font_options_t * options);
+
+void cairo_font_options_set_antialias(cairo_font_options_t * options, cairo_antialias_t antialias);
+cairo_antialias_t cairo_font_options_get_antialias(cairo_font_options_t * options);
+
+void cairo_font_options_set_subpixel_order(cairo_font_options_t * options,
+ cairo_subpixel_order_t subpixel_order);
+cairo_subpixel_order_t cairo_font_options_get_subpixel_order(cairo_font_options_t * options);
+
+void cairo_font_options_set_hint_style(cairo_font_options_t * options, cairo_hint_style_t hint_style);
+cairo_hint_style_t cairo_font_options_get_hint_style(cairo_font_options_t * options);
+
+void cairo_font_options_set_hint_metrics(cairo_font_options_t * options,
+ cairo_hint_metrics_t hint_metrics);
+cairo_hint_metrics_t cairo_font_options_get_hint_metrics(cairo_font_options_t * options);
+
+void cairo_select_font_face(cairo_t * cr,
+ const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight);
+
+void cairo_set_font_size(cairo_t * cr, double size);
+
+void cairo_set_font_matrix(cairo_t * cr, cairo_matrix_t * matrix);
+
+void cairo_get_font_matrix(cairo_t * cr, cairo_matrix_t * matrix);
+
+void cairo_set_font_options(cairo_t * cr, cairo_font_options_t * options);
+
+void cairo_get_font_options(cairo_t * cr, cairo_font_options_t * options);
+
+void cairo_set_font_face(cairo_t * cr, cairo_font_face_t * font_face);
+
+cairo_font_face_t *cairo_get_font_face(cairo_t * cr);
+
+void cairo_set_scaled_font(cairo_t * cr, cairo_scaled_font_t * scaled_font);
+
+cairo_scaled_font_t *cairo_get_scaled_font(cairo_t * cr);
+
+void cairo_show_text(cairo_t * cr, const char *utf8);
+
+void cairo_show_glyphs(cairo_t * cr, const cairo_glyph_t * glyphs, int num_glyphs);
+
+void cairo_show_text_glyphs(cairo_t * cr,
+ const char *utf8,
+ int utf8_len,
+ const cairo_glyph_t * glyphs,
+ int num_glyphs,
+ const cairo_text_cluster_t * clusters,
+ int num_clusters, cairo_text_cluster_flags_t cluster_flags);
+
+void cairo_text_path(cairo_t * cr, const char *utf8);
+
+void cairo_glyph_path(cairo_t * cr, const cairo_glyph_t * glyphs, int num_glyphs);
+
+void cairo_text_extents(cairo_t * cr, const char *utf8, cairo_text_extents_t * extents);
+
+void cairo_glyph_extents(cairo_t * cr,
+ const cairo_glyph_t * glyphs, int num_glyphs, cairo_text_extents_t * extents);
+
+void cairo_font_extents(cairo_t * cr, cairo_font_extents_t * extents);
+
+cairo_font_face_t *cairo_font_face_reference(cairo_font_face_t * font_face);
+
+void cairo_font_face_destroy(cairo_font_face_t * font_face);
+
+unsigned int cairo_font_face_get_reference_count(cairo_font_face_t * font_face);
+
+cairo_status_t cairo_font_face_status(cairo_font_face_t * font_face);
+
+typedef enum _cairo_font_type {
+ CAIRO_FONT_TYPE_TOY,
+ CAIRO_FONT_TYPE_FT,
+ CAIRO_FONT_TYPE_WIN32,
+ CAIRO_FONT_TYPE_QUARTZ,
+ CAIRO_FONT_TYPE_USER
+} cairo_font_type_t;
+
+cairo_font_type_t cairo_font_face_get_type(cairo_font_face_t * font_face);
+
+void *cairo_font_face_get_user_data(cairo_font_face_t * font_face,
+ const cairo_user_data_key_t * key);
+
+cairo_status_t cairo_font_face_set_user_data(cairo_font_face_t * font_face,
+ const cairo_user_data_key_t * key,
+ void *user_data, cairo_destroy_func_t destroy);
+
+cairo_scaled_font_t *cairo_scaled_font_create(cairo_font_face_t * font_face,
+ cairo_matrix_t * font_matrix,
+ cairo_matrix_t * ctm,
+ cairo_font_options_t * options);
+
+cairo_scaled_font_t *cairo_scaled_font_reference(cairo_scaled_font_t * scaled_font);
+
+void cairo_scaled_font_destroy(cairo_scaled_font_t * scaled_font);
+
+unsigned int cairo_scaled_font_get_reference_count(cairo_scaled_font_t * scaled_font);
+
+cairo_status_t cairo_scaled_font_status(cairo_scaled_font_t * scaled_font);
+
+cairo_font_type_t cairo_scaled_font_get_type(cairo_scaled_font_t * scaled_font);
+
+void *cairo_scaled_font_get_user_data(cairo_scaled_font_t * scaled_font,
+ const cairo_user_data_key_t * key);
+
+cairo_status_t cairo_scaled_font_set_user_data(cairo_scaled_font_t * scaled_font,
+ const cairo_user_data_key_t * key,
+ void *user_data, cairo_destroy_func_t destroy);
+
+void cairo_scaled_font_extents(cairo_scaled_font_t * scaled_font, cairo_font_extents_t * extents);
+
+void cairo_scaled_font_text_extents(cairo_scaled_font_t * scaled_font,
+ const char *utf8, cairo_text_extents_t * extents);
+
+void cairo_scaled_font_glyph_extents(cairo_scaled_font_t * scaled_font,
+ const cairo_glyph_t * glyphs,
+ int num_glyphs, cairo_text_extents_t * extents);
+
+cairo_status_t cairo_scaled_font_text_to_glyphs(cairo_scaled_font_t * scaled_font,
+ double x,
+ double y,
+ const char *utf8,
+ int utf8_len,
+ cairo_glyph_t ** glyphs,
+ int *num_glyphs,
+ cairo_text_cluster_t ** clusters,
+ int *num_clusters, cairo_text_cluster_flags_t * cluster_flags);
+
+cairo_font_face_t *cairo_scaled_font_get_font_face(cairo_scaled_font_t * scaled_font);
+
+void cairo_scaled_font_get_font_matrix(cairo_scaled_font_t * scaled_font, cairo_matrix_t * font_matrix);
+
+void cairo_scaled_font_get_ctm(cairo_scaled_font_t * scaled_font, cairo_matrix_t * ctm);
+
+void cairo_scaled_font_get_scale_matrix(cairo_scaled_font_t * scaled_font,
+ cairo_matrix_t * scale_matrix);
+
+void cairo_scaled_font_get_font_options(cairo_scaled_font_t * scaled_font,
+ cairo_font_options_t * options);
+
+cairo_font_face_t *cairo_toy_font_face_create(const char *family,
+ cairo_font_slant_t slant, cairo_font_weight_t weight);
+
+const char *cairo_toy_font_face_get_family(cairo_font_face_t * font_face);
+
+cairo_font_slant_t cairo_toy_font_face_get_slant(cairo_font_face_t * font_face);
+
+cairo_font_weight_t cairo_toy_font_face_get_weight(cairo_font_face_t * font_face);
+
+cairo_font_face_t *cairo_user_font_face_create(void);
+
+void cairo_user_font_face_set_init_func(cairo_font_face_t * font_face,
+ cairo_user_scaled_font_init_func_t init_func);
+
+void cairo_user_font_face_set_render_glyph_func(cairo_font_face_t * font_face,
+ cairo_user_scaled_font_render_glyph_func_t
+ render_glyph_func);
+
+void cairo_user_font_face_set_text_to_glyphs_func(cairo_font_face_t * font_face,
+ cairo_user_scaled_font_text_to_glyphs_func_t
+ text_to_glyphs_func);
+
+void cairo_user_font_face_set_unicode_to_glyph_func(cairo_font_face_t * font_face,
+ cairo_user_scaled_font_unicode_to_glyph_func_t
+ unicode_to_glyph_func);
+
+cairo_user_scaled_font_init_func_t cairo_user_font_face_get_init_func(cairo_font_face_t * font_face);
+
+cairo_user_scaled_font_render_glyph_func_t cairo_user_font_face_get_render_glyph_func(cairo_font_face_t * font_face);
+
+cairo_user_scaled_font_text_to_glyphs_func_t cairo_user_font_face_get_text_to_glyphs_func(cairo_font_face_t * font_face);
+
+cairo_user_scaled_font_unicode_to_glyph_func_t cairo_user_font_face_get_unicode_to_glyph_func(cairo_font_face_t * font_face);
+
+cairo_operator_t cairo_get_operator(cairo_t * cr);
+
+cairo_pattern_t *cairo_get_source(cairo_t * cr);
+
+double cairo_get_tolerance(cairo_t * cr);
+
+cairo_antialias_t cairo_get_antialias(cairo_t * cr);
+
+cairo_bool_t cairo_has_current_point(cairo_t * cr);
+
+void cairo_get_current_point(cairo_t * cr, double *x, double *y);
+
+cairo_fill_rule_t cairo_get_fill_rule(cairo_t * cr);
+
+double cairo_get_line_width(cairo_t * cr);
+
+cairo_line_cap_t cairo_get_line_cap(cairo_t * cr);
+
+cairo_line_join_t cairo_get_line_join(cairo_t * cr);
+
+double cairo_get_miter_limit(cairo_t * cr);
+
+int cairo_get_dash_count(cairo_t * cr);
+
+void cairo_get_dash(cairo_t * cr, double *dashes, double *offset);
+
+void cairo_get_matrix(cairo_t * cr, cairo_matrix_t * matrix);
+
+cairo_surface_t *cairo_get_target(cairo_t * cr);
+
+cairo_surface_t *cairo_get_group_target(cairo_t * cr);
+
+typedef enum _cairo_path_data_type {
+ CAIRO_PATH_MOVE_TO,
+ CAIRO_PATH_LINE_TO,
+ CAIRO_PATH_CURVE_TO,
+ CAIRO_PATH_CLOSE_PATH
+} cairo_path_data_type_t;
+
+typedef union _cairo_path_data_t cairo_path_data_t;
+
+typedef struct cairo_path {
+ cairo_status_t status;
+ cairo_path_data_t *data;
+ int num_data;
+} cairo_path_t;
+
+cairo_path_t *cairo_copy_path(cairo_t * cr);
+
+cairo_path_t *cairo_copy_path_flat(cairo_t * cr);
+
+void cairo_append_path(cairo_t * cr, const cairo_path_t * path);
+
+void cairo_path_destroy(cairo_path_t * path);
+
+cairo_status_t cairo_status(cairo_t * cr);
+
+const char *cairo_status_to_string(cairo_status_t status);
+
+cairo_surface_t *cairo_surface_create_similar(cairo_surface_t * other,
+ cairo_content_t content, int width, int height);
+
+cairo_surface_t *cairo_surface_reference(cairo_surface_t * surface);
+
+void cairo_surface_finish(cairo_surface_t * surface);
+
+void cairo_surface_destroy(cairo_surface_t * surface);
+
+unsigned int cairo_surface_get_reference_count(cairo_surface_t * surface);
+
+cairo_status_t cairo_surface_status(cairo_surface_t * surface);
+
+typedef enum _cairo_surface_type {
+ CAIRO_SURFACE_TYPE_IMAGE,
+ CAIRO_SURFACE_TYPE_PDF,
+ CAIRO_SURFACE_TYPE_PS,
+ CAIRO_SURFACE_TYPE_XLIB,
+ CAIRO_SURFACE_TYPE_XCB,
+ CAIRO_SURFACE_TYPE_GLITZ,
+ CAIRO_SURFACE_TYPE_QUARTZ,
+ CAIRO_SURFACE_TYPE_WIN32,
+ CAIRO_SURFACE_TYPE_BEOS,
+ CAIRO_SURFACE_TYPE_DIRECTFB,
+ CAIRO_SURFACE_TYPE_SVG,
+ CAIRO_SURFACE_TYPE_OS2,
+ CAIRO_SURFACE_TYPE_WIN32_PRINTING,
+ CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
+} cairo_surface_type_t;
+
+cairo_surface_type_t cairo_surface_get_type(cairo_surface_t * surface);
+
+cairo_content_t cairo_surface_get_content(cairo_surface_t * surface);
+
+
+cairo_status_t cairo_surface_write_to_png(cairo_surface_t * surface, const char *filename);
+
+cairo_status_t cairo_surface_write_to_png_stream(cairo_surface_t * surface,
+ cairo_write_func_t write_func, void *closure);
+
+void *cairo_surface_get_user_data(cairo_surface_t * surface, const cairo_user_data_key_t * key);
+
+cairo_status_t cairo_surface_set_user_data(cairo_surface_t * surface,
+ const cairo_user_data_key_t * key,
+ void *user_data, cairo_destroy_func_t destroy);
+
+void cairo_surface_get_font_options(cairo_surface_t * surface, cairo_font_options_t * options);
+
+void cairo_surface_flush(cairo_surface_t * surface);
+
+void cairo_surface_mark_dirty(cairo_surface_t * surface);
+
+void cairo_surface_mark_dirty_rectangle(cairo_surface_t * surface, int x, int y, int width, int height);
+
+void cairo_surface_set_device_offset(cairo_surface_t * surface, double x_offset, double y_offset);
+
+void cairo_surface_get_device_offset(cairo_surface_t * surface, double *x_offset, double *y_offset);
+
+void cairo_surface_set_fallback_resolution(cairo_surface_t * surface,
+ double x_pixels_per_inch, double y_pixels_per_inch);
+
+void cairo_surface_get_fallback_resolution(cairo_surface_t * surface,
+ double *x_pixels_per_inch, double *y_pixels_per_inch);
+
+void cairo_surface_copy_page(cairo_surface_t * surface);
+
+void cairo_surface_show_page(cairo_surface_t * surface);
+
+cairo_bool_t cairo_surface_has_show_text_glyphs(cairo_surface_t * surface);
+
+typedef enum _cairo_format {
+ CAIRO_FORMAT_ARGB32,
+ CAIRO_FORMAT_RGB24,
+ CAIRO_FORMAT_A8,
+ CAIRO_FORMAT_A1
+} cairo_format_t;
+
+cairo_surface_t *cairo_image_surface_create(cairo_format_t format, int width, int height);
+
+int cairo_format_stride_for_width(cairo_format_t format, int width);
+
+cairo_surface_t *cairo_image_surface_create_for_data(unsigned char *data,
+ cairo_format_t format,
+ int width, int height, int stride);
+
+unsigned char *cairo_image_surface_get_data(cairo_surface_t * surface);
+
+cairo_format_t cairo_image_surface_get_format(cairo_surface_t * surface);
+
+int cairo_image_surface_get_width(cairo_surface_t * surface);
+
+int cairo_image_surface_get_height(cairo_surface_t * surface);
+
+int cairo_image_surface_get_stride(cairo_surface_t * surface);
+
+
+cairo_surface_t *cairo_image_surface_create_from_png(const char *filename);
+
+cairo_surface_t *cairo_image_surface_create_from_png_stream(cairo_read_func_t read_func,
+ void *closure);
+
+cairo_pattern_t *cairo_pattern_create_rgb(double red, double green, double blue);
+
+cairo_pattern_t *cairo_pattern_create_rgba(double red, double green, double blue, double alpha);
+
+cairo_pattern_t *cairo_pattern_create_for_surface(cairo_surface_t * surface);
+
+cairo_pattern_t *cairo_pattern_create_linear(double x0, double y0, double x1, double y1);
+
+cairo_pattern_t *cairo_pattern_create_radial(double cx0, double cy0, double radius0,
+ double cx1, double cy1, double radius1);
+
+cairo_pattern_t *cairo_pattern_reference(cairo_pattern_t * pattern);
+
+void cairo_pattern_destroy(cairo_pattern_t * pattern);
+
+unsigned int cairo_pattern_get_reference_count(cairo_pattern_t * pattern);
+
+cairo_status_t cairo_pattern_status(cairo_pattern_t * pattern);
+
+void *cairo_pattern_get_user_data(cairo_pattern_t * pattern, const cairo_user_data_key_t * key);
+
+cairo_status_t cairo_pattern_set_user_data(cairo_pattern_t * pattern,
+ const cairo_user_data_key_t * key,
+ void *user_data, cairo_destroy_func_t destroy);
+
+typedef enum _cairo_pattern_type {
+ CAIRO_PATTERN_TYPE_SOLID,
+ CAIRO_PATTERN_TYPE_SURFACE,
+ CAIRO_PATTERN_TYPE_LINEAR,
+ CAIRO_PATTERN_TYPE_RADIAL
+} cairo_pattern_type_t;
+
+cairo_pattern_type_t cairo_pattern_get_type(cairo_pattern_t * pattern);
+
+void cairo_pattern_add_color_stop_rgb(cairo_pattern_t * pattern, double offset,
+ double red, double green, double blue);
+
+void cairo_pattern_add_color_stop_rgba(cairo_pattern_t * pattern, double
+ offset, double red, double green, double blue, double alpha);
+
+void cairo_pattern_set_matrix(cairo_pattern_t * pattern, cairo_matrix_t * matrix);
+
+void cairo_pattern_get_matrix(cairo_pattern_t * pattern, cairo_matrix_t * matrix);
+
+typedef enum _cairo_extend {
+ CAIRO_EXTEND_NONE,
+ CAIRO_EXTEND_REPEAT,
+ CAIRO_EXTEND_REFLECT,
+ CAIRO_EXTEND_PAD
+} cairo_extend_t;
+
+void cairo_pattern_set_extend(cairo_pattern_t * pattern, cairo_extend_t extend);
+
+cairo_extend_t cairo_pattern_get_extend(cairo_pattern_t * pattern);
+
+void cairo_pattern_set_filter(cairo_pattern_t * pattern, cairo_filter_t filter);
+
+cairo_filter_t cairo_pattern_get_filter(cairo_pattern_t * pattern);
+
+cairo_status_t cairo_pattern_get_rgba(cairo_pattern_t * pattern,
+ double *red, double *green, double *blue, double *alpha);
+
+cairo_status_t cairo_pattern_get_surface(cairo_pattern_t * pattern, cairo_surface_t ** surface);
+
+cairo_status_t cairo_pattern_get_color_stop_rgba(cairo_pattern_t * pattern,
+ int index, double *offset,
+ double *red, double *green, double *blue, double *alpha);
+
+cairo_status_t cairo_pattern_get_color_stop_count(cairo_pattern_t * pattern, int *count);
+
+cairo_status_t cairo_pattern_get_linear_points(cairo_pattern_t * pattern,
+ double *x0, double *y0, double *x1, double *y1);
+
+cairo_status_t cairo_pattern_get_radial_circles(cairo_pattern_t * pattern,
+ double *x0, double *y0, double *r0,
+ double *x1, double *y1, double *r1);
+
+void cairo_matrix_init(cairo_matrix_t * matrix, double xx, double yx, double
+ xy, double yy, double x0, double y0);
+
+void cairo_matrix_init_identity(cairo_matrix_t * matrix);
+
+void cairo_matrix_init_translate(cairo_matrix_t * matrix, double tx, double ty);
+
+void cairo_matrix_init_scale(cairo_matrix_t * matrix, double sx, double sy);
+
+void cairo_matrix_init_rotate(cairo_matrix_t * matrix, double radians);
+
+void cairo_matrix_translate(cairo_matrix_t * matrix, double tx, double ty);
+
+void cairo_matrix_scale(cairo_matrix_t * matrix, double sx, double sy);
+
+void cairo_matrix_rotate(cairo_matrix_t * matrix, double radians);
+
+cairo_status_t cairo_matrix_invert(cairo_matrix_t * matrix);
+
+void cairo_matrix_multiply(cairo_matrix_t * result, cairo_matrix_t * a,
+ cairo_matrix_t * b);
+
+void cairo_matrix_transform_distance(cairo_matrix_t * matrix, double *dx, double *dy);
+
+void cairo_matrix_transform_point(cairo_matrix_t * matrix, double *x, double *y);
+
+void cairo_debug_reset_static_data(void);
--- /dev/null
+$#include <Imlib2.h>
+$#include <X11/Xlib.h>
+
+$#define _userdata void*
+
+typedef void *Imlib_Context;
+typedef void *Imlib_Image;
+typedef void *Imlib_Color_Modifier;
+typedef void *Imlib_Updates;
+typedef void *Imlib_Font;
+typedef void *Imlib_Color_Range;
+typedef void *Imlib_Filter;
+typedef struct _imlib_color Imlib_Color;
+typedef void *ImlibPolygon;
+
+enum _imlib_operation
+{
+ IMLIB_OP_COPY,
+ IMLIB_OP_ADD,
+ IMLIB_OP_SUBTRACT,
+ IMLIB_OP_RESHADE
+};
+
+enum _imlib_text_direction
+{
+ IMLIB_TEXT_TO_RIGHT = 0,
+ IMLIB_TEXT_TO_LEFT = 1,
+ IMLIB_TEXT_TO_DOWN = 2,
+ IMLIB_TEXT_TO_UP = 3,
+ IMLIB_TEXT_TO_ANGLE = 4
+};
+
+enum _imlib_load_error
+{
+ IMLIB_LOAD_ERROR_NONE,
+ IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST,
+ IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY,
+ IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ,
+ IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT,
+ IMLIB_LOAD_ERROR_PATH_TOO_LONG,
+ IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT,
+ IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY,
+ IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE,
+ IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS,
+ IMLIB_LOAD_ERROR_OUT_OF_MEMORY,
+ IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS,
+ IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE,
+ IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE,
+ IMLIB_LOAD_ERROR_UNKNOWN
+};
+
+enum _imlib_TTF_encoding
+{
+ IMLIB_TTF_ENCODING_ISO_8859_1,
+ IMLIB_TTF_ENCODING_ISO_8859_2,
+ IMLIB_TTF_ENCODING_ISO_8859_3,
+ IMLIB_TTF_ENCODING_ISO_8859_4,
+ IMLIB_TTF_ENCODING_ISO_8859_5
+};
+
+typedef enum _imlib_operation Imlib_Operation;
+typedef enum _imlib_load_error Imlib_Load_Error;
+typedef enum _imlib_load_error ImlibLoadError;
+typedef enum _imlib_text_direction Imlib_Text_Direction;
+typedef enum _imlib_TTF_encoding Imlib_TTF_Encoding;
+
+typedef struct _imlib_border Imlib_Border;
+
+Imlib_Context imlib_context_new(void);
+void imlib_context_free(Imlib_Context context);
+
+void imlib_context_push(Imlib_Context context);
+void imlib_context_pop(void);
+Imlib_Context imlib_context_get(void);
+
+void imlib_context_set_display(Display * display);
+void imlib_context_disconnect_display(void);
+void imlib_context_set_visual(Visual * visual);
+void imlib_context_set_colormap(Colormap colormap);
+void imlib_context_set_drawable(Drawable drawable);
+void imlib_context_set_mask(Pixmap mask);
+void imlib_context_set_dither_mask(char dither_mask);
+void imlib_context_set_mask_alpha_threshold(int mask_alpha_threshold);
+void imlib_context_set_anti_alias(char anti_alias);
+void imlib_context_set_dither(char dither);
+void imlib_context_set_blend(char blend);
+void imlib_context_set_color_modifier(Imlib_Color_Modifier color_modifier);
+void imlib_context_set_operation(Imlib_Operation operation);
+void imlib_context_set_font(Imlib_Font font);
+void imlib_context_set_direction(Imlib_Text_Direction direction);
+void imlib_context_set_angle(double angle);
+void imlib_context_set_color(int red, int green, int blue, int alpha);
+void imlib_context_set_color_hsva(float hue, float saturation, float value, int alpha);
+void imlib_context_set_color_hlsa(float hue, float lightness, float saturation, int alpha);
+void imlib_context_set_color_cmya(int cyan, int magenta, int yellow, int alpha);
+void imlib_context_set_color_range(Imlib_Color_Range color_range);
+void imlib_context_set_progress_function(Imlib_Progress_Function
+ progress_function);
+void imlib_context_set_progress_granularity(char progress_granularity);
+void imlib_context_set_image(Imlib_Image image);
+void imlib_context_set_cliprect(int x, int y, int w, int h);
+void imlib_context_set_TTF_encoding(Imlib_TTF_Encoding encoding);
+
+Display *imlib_context_get_display(void);
+Visual *imlib_context_get_visual(void);
+Colormap imlib_context_get_colormap(void);
+Drawable imlib_context_get_drawable(void);
+Pixmap imlib_context_get_mask(void);
+char imlib_context_get_dither_mask(void);
+char imlib_context_get_anti_alias(void);
+int imlib_context_get_mask_alpha_threshold(void);
+char imlib_context_get_dither(void);
+char imlib_context_get_blend(void);
+Imlib_Color_Modifier imlib_context_get_color_modifier(void);
+Imlib_Operation imlib_context_get_operation(void);
+Imlib_Font imlib_context_get_font(void);
+double imlib_context_get_angle(void);
+Imlib_Text_Direction imlib_context_get_direction(void);
+void imlib_context_get_color(int *red, int *green, int *blue, int *alpha);
+void imlib_context_get_color_hsva(float *hue, float *saturation, float *value, int *alpha);
+void imlib_context_get_color_hlsa(float *hue, float *lightness, float *saturation, int *alpha);
+void imlib_context_get_color_cmya(int *cyan, int *magenta, int *yellow, int *alpha);
+Imlib_Color *imlib_context_get_imlib_color(void);
+Imlib_Color_Range imlib_context_get_color_range(void);
+Imlib_Progress_Function imlib_context_get_progress_function(void);
+char imlib_context_get_progress_granularity(void);
+Imlib_Image imlib_context_get_image(void);
+void imlib_context_get_cliprect(int *x, int *y, int *w, int *h);
+Imlib_TTF_Encoding imlib_context_get_TTF_encoding(void);
+
+int imlib_get_cache_size(void);
+void imlib_set_cache_size(int bytes);
+int imlib_get_color_usage(void);
+void imlib_set_color_usage(int max);
+void imlib_flush_loaders(void);
+int imlib_get_visual_depth(Display * display, Visual * visual);
+Visual *imlib_get_best_visual(Display * display, int screen,
+ int *depth_return);
+
+Imlib_Image imlib_load_image(const char *file);
+Imlib_Image imlib_load_image_immediately(const char *file);
+Imlib_Image imlib_load_image_without_cache(const char *file);
+Imlib_Image imlib_load_image_immediately_without_cache(const char *file);
+Imlib_Image imlib_load_image_with_error_return(const char *file,
+ Imlib_Load_Error *
+ error_return);
+void imlib_free_image(void);
+void imlib_free_image_and_decache(void);
+
+int imlib_image_get_width(void);
+int imlib_image_get_height(void);
+const char *imlib_image_get_filename(void);
+int *imlib_image_get_data(void);
+int *imlib_image_get_data_for_reading_only(void);
+void imlib_image_put_back_data(unsigned int * data);
+char imlib_image_has_alpha(void);
+void imlib_image_set_changes_on_disk(void);
+void imlib_image_get_border(Imlib_Border * border);
+void imlib_image_set_border(Imlib_Border * border);
+void imlib_image_set_format(const char *format);
+void imlib_image_set_irrelevant_format(char irrelevant);
+void imlib_image_set_irrelevant_border(char irrelevant);
+void imlib_image_set_irrelevant_alpha(char irrelevant);
+char *imlib_image_format(void);
+void imlib_image_set_has_alpha(char has_alpha);
+void imlib_image_query_pixel(int x, int y, Imlib_Color * color_return);
+void imlib_image_query_pixel_hsva(int x, int y, float *hue, float *saturation, float *value, int *alpha);
+void imlib_image_query_pixel_hlsa(int x, int y, float *hue, float *lightness, float *saturation, int *alpha);
+void imlib_image_query_pixel_cmya(int x, int y, int *cyan, int *magenta, int *yellow, int *alpha);
+
+void imlib_render_pixmaps_for_whole_image(Pixmap * pixmap_return,
+ Pixmap * mask_return);
+void imlib_render_pixmaps_for_whole_image_at_size(Pixmap * pixmap_return,
+ Pixmap * mask_return,
+ int width, int height);
+void imlib_free_pixmap_and_mask(Pixmap pixmap);
+void imlib_render_image_on_drawable(int x, int y);
+void imlib_render_image_on_drawable_at_size(int x, int y, int width,
+ int height);
+void imlib_render_image_part_on_drawable_at_size(int source_x,
+ int source_y,
+ int source_width,
+ int source_height, int x,
+ int y, int width,
+ int height);
+unsigned int imlib_render_get_pixel_color(void);
+void imlib_blend_image_onto_image(Imlib_Image source_image,
+ char merge_alpha, int source_x,
+ int source_y, int source_width,
+ int source_height, int destination_x,
+ int destination_y, int destination_width,
+ int destination_height);
+
+Imlib_Image imlib_create_image(int width, int height);
+Imlib_Image imlib_create_image_using_data(int width, int height,
+ unsigned int * data);
+Imlib_Image imlib_create_image_using_copied_data(int width, int height,
+ unsigned int * data);
+Imlib_Image imlib_create_image_from_drawable(Pixmap mask, int x, int y,
+ int width, int height,
+ char need_to_grab_x);
+Imlib_Image imlib_create_image_from_ximage(XImage *image, XImage *mask, int x, int y,
+ int width, int height,
+ char need_to_grab_x);
+Imlib_Image imlib_create_scaled_image_from_drawable(Pixmap mask,
+ int source_x,
+ int source_y,
+ int source_width,
+ int source_height,
+ int destination_width,
+ int destination_height,
+ char need_to_grab_x,
+ char
+ get_mask_from_shape);
+char imlib_copy_drawable_to_image(Pixmap mask, int x, int y, int width,
+ int height, int destination_x,
+ int destination_y, char need_to_grab_x);
+Imlib_Image imlib_clone_image(void);
+Imlib_Image imlib_create_cropped_image(int x, int y, int width,
+ int height);
+Imlib_Image imlib_create_cropped_scaled_image(int source_x, int source_y,
+ int source_width,
+ int source_height,
+ int destination_width,
+ int destination_height);
+
+Imlib_Updates imlib_updates_clone(Imlib_Updates updates);
+Imlib_Updates imlib_update_append_rect(Imlib_Updates updates, int x, int y,
+ int w, int h);
+Imlib_Updates imlib_updates_merge(Imlib_Updates updates, int w, int h);
+Imlib_Updates imlib_updates_merge_for_rendering(Imlib_Updates updates,
+ int w, int h);
+void imlib_updates_free(Imlib_Updates updates);
+Imlib_Updates imlib_updates_get_next(Imlib_Updates updates);
+void imlib_updates_get_coordinates(Imlib_Updates updates, int *x_return,
+ int *y_return, int *width_return,
+ int *height_return);
+void imlib_updates_set_coordinates(Imlib_Updates updates, int x, int y,
+ int width, int height);
+void imlib_render_image_updates_on_drawable(Imlib_Updates updates, int x,
+ int y);
+Imlib_Updates imlib_updates_init(void);
+Imlib_Updates imlib_updates_append_updates(Imlib_Updates updates,
+ Imlib_Updates appended_updates);
+
+void imlib_image_flip_horizontal(void);
+void imlib_image_flip_vertical(void);
+void imlib_image_flip_diagonal(void);
+void imlib_image_orientate(int orientation);
+void imlib_image_blur(int radius);
+void imlib_image_sharpen(int radius);
+void imlib_image_tile_horizontal(void);
+void imlib_image_tile_vertical(void);
+void imlib_image_tile(void);
+
+Imlib_Font imlib_load_font(const char *font_name);
+void imlib_free_font(void);
+int imlib_insert_font_into_fallback_chain(Imlib_Font font, Imlib_Font fallback_font);
+void imlib_remove_font_from_fallback_chain(Imlib_Font fallback_font);
+Imlib_Font imlib_get_prev_font_in_fallback_chain(Imlib_Font fn);
+Imlib_Font imlib_get_next_font_in_fallback_chain(Imlib_Font fn);
+void imlib_text_draw(int x, int y, const char *text);
+void imlib_text_draw_with_return_metrics(int x, int y, const char *text,
+ int *width_return,
+ int *height_return,
+ int *horizontal_advance_return,
+ int *vertical_advance_return);
+void imlib_get_text_size(const char *text, int *width_return,
+ int *height_return);
+void imlib_get_text_advance(const char *text,
+ int *horizontal_advance_return,
+ int *vertical_advance_return);
+int imlib_get_text_inset(const char *text);
+void imlib_add_path_to_font_path(const char *path);
+void imlib_remove_path_from_font_path(const char *path);
+char **imlib_list_font_path(int *number_return);
+int imlib_text_get_index_and_location(const char *text, int x, int y,
+ int *char_x_return,
+ int *char_y_return,
+ int *char_width_return,
+ int *char_height_return);
+void imlib_text_get_location_at_index(const char *text, int index,
+ int *char_x_return,
+ int *char_y_return,
+ int *char_width_return,
+ int *char_height_return);
+char **imlib_list_fonts(int *number_return);
+void imlib_free_font_list(char **font_list, int number);
+int imlib_get_font_cache_size(void);
+void imlib_set_font_cache_size(int bytes);
+void imlib_flush_font_cache(void);
+int imlib_get_font_ascent(void);
+int imlib_get_font_descent(void);
+int imlib_get_maximum_font_ascent(void);
+int imlib_get_maximum_font_descent(void);
+
+Imlib_Color_Modifier imlib_create_color_modifier(void);
+void imlib_free_color_modifier(void);
+void imlib_modify_color_modifier_gamma(double gamma_value);
+void imlib_modify_color_modifier_brightness(double brightness_value);
+void imlib_modify_color_modifier_contrast(double contrast_value);
+void imlib_set_color_modifier_tables(unsigned char * red_table,
+ unsigned char * green_table,
+ unsigned char * blue_table,
+ unsigned char * alpha_table);
+void imlib_get_color_modifier_tables(unsigned char * red_table,
+ unsigned char * green_table,
+ unsigned char * blue_table,
+ unsigned char * alpha_table);
+void imlib_reset_color_modifier(void);
+void imlib_apply_color_modifier(void);
+void imlib_apply_color_modifier_to_rectangle(int x, int y, int width,
+ int height);
+
+Imlib_Updates imlib_image_draw_pixel(int x, int y, char make_updates);
+Imlib_Updates imlib_image_draw_line(int x1, int y1, int x2, int y2,
+ char make_updates);
+int imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax,
+ int ymin, int ymax, int *clip_x0, int *clip_y0,
+ int *clip_x1, int *clip_y1);
+void imlib_image_draw_rectangle(int x, int y, int width, int height);
+void imlib_image_fill_rectangle(int x, int y, int width, int height);
+void imlib_image_copy_alpha_to_image(Imlib_Image image_source, int x,
+ int y);
+void imlib_image_copy_alpha_rectangle_to_image(Imlib_Image image_source,
+ int x, int y, int width,
+ int height,
+ int destination_x,
+ int destination_y);
+void imlib_image_scroll_rect(int x, int y, int width, int height,
+ int delta_x, int delta_y);
+void imlib_image_copy_rect(int x, int y, int width, int height, int new_x,
+ int new_y);
+
+ImlibPolygon imlib_polygon_new(void);
+void imlib_polygon_free(ImlibPolygon poly);
+void imlib_polygon_add_point(ImlibPolygon poly, int x, int y);
+void imlib_image_draw_polygon(ImlibPolygon poly, unsigned char closed);
+void imlib_image_fill_polygon(ImlibPolygon poly);
+void imlib_polygon_get_bounds(ImlibPolygon poly, int *px1, int *py1,
+ int *px2, int *py2);
+unsigned char imlib_polygon_contains_point(ImlibPolygon poly, int x,
+ int y);
+
+void imlib_image_draw_ellipse(int xc, int yc, int a, int b);
+void imlib_image_fill_ellipse(int xc, int yc, int a, int b);
+
+Imlib_Color_Range imlib_create_color_range(void);
+void imlib_free_color_range(void);
+void imlib_add_color_to_color_range(int distance_away);
+void imlib_image_fill_color_range_rectangle(int x, int y, int width,
+ int height, double angle);
+void imlib_image_fill_hsva_color_range_rectangle(int x, int y, int width,
+ int height, double angle);
+
+void imlib_image_attach_data_value(const char *key, void *data, int value,
+ Imlib_Data_Destructor_Function
+ destructor_function);
+void *imlib_image_get_attached_data(const char *key);
+int imlib_image_get_attached_value(const char *key);
+void imlib_image_remove_attached_data_value(const char *key);
+void imlib_image_remove_and_free_attached_data_value(const char *key);
+
+void imlib_save_image(const char *filename);
+void imlib_save_image_with_error_return(const char *filename,
+ Imlib_Load_Error * error_return);
+
+Imlib_Image imlib_create_rotated_image(double angle);
+
+void imlib_rotate_image_from_buffer(double angle,
+ Imlib_Image source_image);
+
+void imlib_blend_image_onto_image_at_angle(Imlib_Image source_image,
+ char merge_alpha, int source_x,
+ int source_y, int source_width,
+ int source_height,
+ int destination_x,
+ int destination_y, int angle_x,
+ int angle_y);
+void imlib_blend_image_onto_image_skewed(Imlib_Image source_image,
+ char merge_alpha, int source_x,
+ int source_y, int source_width,
+ int source_height,
+ int destination_x,
+ int destination_y, int h_angle_x,
+ int h_angle_y, int v_angle_x,
+ int v_angle_y);
+void imlib_render_image_on_drawable_skewed(int source_x, int source_y,
+ int source_width,
+ int source_height,
+ int destination_x,
+ int destination_y,
+ int h_angle_x, int h_angle_y,
+ int v_angle_x, int v_angle_y);
+void imlib_render_image_on_drawable_at_angle(int source_x, int source_y,
+ int source_width,
+ int source_height,
+ int destination_x,
+ int destination_y,
+ int angle_x, int angle_y);
+
+void imlib_image_filter(void);
+Imlib_Filter imlib_create_filter(int initsize);
+void imlib_context_set_filter(Imlib_Filter filter);
+Imlib_Filter imlib_context_get_filter(void);
+void imlib_free_filter(void);
+void imlib_filter_set(int xoff, int yoff, int a, int r, int g, int b);
+void imlib_filter_set_alpha(int xoff, int yoff, int a, int r, int g,
+ int b);
+void imlib_filter_set_red(int xoff, int yoff, int a, int r, int g, int b);
+void imlib_filter_set_green(int xoff, int yoff, int a, int r, int g,
+ int b);
+void imlib_filter_set_blue(int xoff, int yoff, int a, int r, int g, int b);
+void imlib_filter_constants(int a, int r, int g, int b);
+void imlib_filter_divisors(int a, int r, int g, int b);
+
+void imlib_image_clear(void);
+void imlib_image_clear_color(int r, int g, int b, int a);
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-INCLUDES = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\"
+INCLUDES = -DSYSTEM_CONFIG_FILE=\"$(sysconfdir)/conky/conky.conf\" -DPACKAGE_LIBDIR=\"$(pkglibdir)\"
bin_PROGRAMS = conky
+LIBS = ${conky_LIBS}
+
if BUILD_CONFIG_OUTPUT
config_output = defconfig.h
config_cookie = conf_cookie.c conf_cookie.h
printf(PACKAGE_NAME" "VERSION" compiled "BUILD_DATE" for "BUILD_ARCH"\n");
printf("\nCompiled in features:\n\n"
- "System config file: "SYSTEM_CONFIG_FILE"\n\n"
+ "System config file: "SYSTEM_CONFIG_FILE"\n"
+ "Package library path: "PACKAGE_LIBDIR"\n\n"
#ifdef X11
" X11:\n"
# ifdef HAVE_XDAMAGE
" * RSS\n"
#endif /* RSS */
#ifdef WEATHER
- " * WEATHER\n"
+ " * Weather (METAR)\n"
#endif /* WEATHER */
-#ifdef HAVE_LUA
- " * Lua\n"
-#endif /* HAVE_LUA */
#ifdef HAVE_IWLIB
" * wireless\n"
#endif /* HAVE_IWLIB */
#ifdef IOSTATS
" * iostats\n"
#endif /* IOSTATS */
+#ifdef HAVE_LUA
+ " * Lua\n"
+ "\n Lua bindings:\n"
+#ifdef HAVE_LUA_CAIRO
+ " * Cairo\n"
+#endif /* HAVE_LUA_CAIRO */
+#ifdef HAVE_LUA_IMLIB2
+ " * Imlib2\n"
+#endif /* IMLIB2 */
+#endif /* HAVE_LUA */
);
exit(0);
* instances of the same text object */
struct information info;
-/* default config file */
-static char *current_config;
+/* path to config file */
+char *current_config;
/* set to 1 if you want all text to be in uppercase */
static unsigned int stuff_in_upper_case;
static int draw_shades, draw_outline;
-static long border_inner_margin, border_outer_margin, border_width;
-
static long default_fg_color, default_bg_color, default_out_color;
/* create own window or draw stuff to root? */
static char *template[MAX_TEMPLATES];
/* maximum size of config TEXT buffer, i.e. below TEXT line. */
-static unsigned int max_user_text = MAX_USER_TEXT_DEFAULT;
+unsigned int max_user_text;
/* maximum size of individual text buffers, ie $exec buffer size */
unsigned int text_buffer_size = DEFAULT_TEXT_BUFFER_SIZE;
#endif
#ifdef HAVE_LUA
case OBJ_lua:
- case OBJ_lua_parse:
- case OBJ_lua_read_parse:
case OBJ_lua_bar:
#ifdef X11
case OBJ_lua_graph:
} else {
CRIT_ERR("lua_parse needs arguments: <function name> [function parameters]");
}
- END OBJ(lua_read_parse, 0)
- if (arg) {
- obj->data.s = strndup(arg, text_buffer_size);
- } else {
- CRIT_ERR("lua_read_parse needs arguments: <function name> <string to pass>");
- }
END OBJ(lua_bar, 0)
SIZE_DEFAULTS(bar);
if (arg) {
}
#endif /* IMLIB2 */
OBJ(eval) {
- struct information *tmp_info;
- struct text_object subroot, subroot2;
-
- tmp_info = malloc(sizeof(struct information));
- memcpy(tmp_info, cur, sizeof(struct information));
- parse_conky_vars(&subroot, obj->data.s, p, tmp_info);
- DBGP("evaluated '%s' to '%s'", obj->data.s, p);
- parse_conky_vars(&subroot2, p, p, tmp_info);
-
- free_text_objects(&subroot, 1);
- free_text_objects(&subroot2, 1);
- free(tmp_info);
+ evaluate(obj->data.s, p);
}
OBJ(exec) {
read_exec(obj->data.s, p, text_buffer_size);
#endif
#ifdef WEATHER
OBJ(weather) {
- PWEATHER *data = get_weather_info(obj->data.weather.uri, obj->data.weather.delay);
-
- static const char *wc[18] =
- {"", "drizzle", "rain", "hail", "soft hail",
- "snow", "snow grains", "fog", "haze", "smoke",
- "mist", "dust", "sand", "funnel cloud tornado",
- "dust/sand", "squall", "sand storm", "dust storm"};
-
-
- if (data == NULL) {
- strncpy(p, "Error reading weather data", p_max_size);
- } else {
- if (strcmp(obj->data.weather.data_type, "last_update") == EQUAL) {
- strncpy(p, data->lastupd, p_max_size);
- } else if (strcmp(obj->data.weather.data_type, "temperature_C") == EQUAL) {
- snprintf(p, p_max_size, "%d", data->tmpC);
- } else if (strcmp(obj->data.weather.data_type, "temperature_F") == EQUAL) {
- snprintf(p, p_max_size, "%d", data->tmpF);
- } else if (strcmp(obj->data.weather.data_type, "cloud_cover") == EQUAL) {
- if (data->cc == 0) {
- strncpy(p, "", p_max_size);
- } else if (data->cc < 3) {
- strncpy(p, "clear", p_max_size);
- } else if (data->cc < 5) {
- strncpy(p, "partly cloudy", p_max_size);
- } else if (data->cc == 5) {
- strncpy(p, "cloudy", p_max_size);
- } else if (data->cc == 6) {
- strncpy(p, "overcast", p_max_size);
- } else if (data->cc == 7) {
- strncpy(p, "towering cumulus", p_max_size);
- } else {
- strncpy(p, "cumulonimbus", p_max_size);
- }
- } else if (strcmp(obj->data.weather.data_type, "pressure") == EQUAL) {
- snprintf(p, p_max_size, "%d", data->bar);
- } else if (strcmp(obj->data.weather.data_type, "wind_speed") == EQUAL) {
- snprintf(p, p_max_size, "%d", data->wind_s);
- } else if (strcmp(obj->data.weather.data_type, "wind_dir") == EQUAL) {
- if ((data->wind_d >= 349) || (data->wind_d < 12)) {
- strncpy(p, "N", p_max_size);
- } else if (data->wind_d < 33) {
- strncpy(p, "NNE", p_max_size);
- } else if (data->wind_d < 57) {
- strncpy(p, "NE", p_max_size);
- } else if (data->wind_d < 79) {
- strncpy(p, "ENE", p_max_size);
- } else if (data->wind_d < 102) {
- strncpy(p, "E", p_max_size);
- } else if (data->wind_d < 124) {
- strncpy(p, "ESE", p_max_size);
- } else if (data->wind_d < 147) {
- strncpy(p, "SE", p_max_size);
- } else if (data->wind_d < 169) {
- strncpy(p, "SSE", p_max_size);
- } else if (data->wind_d < 192) {
- strncpy(p, "S", p_max_size);
- } else if (data->wind_d < 214) {
- strncpy(p, "SSW", p_max_size);
- } else if (data->wind_d < 237) {
- strncpy(p, "SW", p_max_size);
- } else if (data->wind_d < 259) {
- strncpy(p, "WSW", p_max_size);
- } else if (data->wind_d < 282) {
- strncpy(p, "W", p_max_size);
- } else if (data->wind_d < 304) {
- strncpy(p, "WNW", p_max_size);
- } else if (data->wind_d < 327) {
- strncpy(p, "NW", p_max_size);
- } else if (data->wind_d < 349) {
- strncpy(p, "NNW", p_max_size);
- };
- } else if (strcmp(obj->data.weather.data_type, "wind_dir_DEG") == EQUAL) {
- snprintf(p, p_max_size, "%d", data->wind_d);
-
- } else if (strcmp(obj->data.weather.data_type, "humidity") == EQUAL) {
- snprintf(p, p_max_size, "%d", data->hmid);
- } else if (strcmp(obj->data.weather.data_type, "weather") == EQUAL) {
- strncpy(p, wc[data->wc], p_max_size);
- }
- }
+ PWEATHER *data = get_weather_info(obj->data.weather.uri, obj->data.weather.delay);
+
+ static const char *wc[18] =
+ {"", "drizzle", "rain", "hail", "soft hail",
+ "snow", "snow grains", "fog", "haze", "smoke",
+ "mist", "dust", "sand", "funnel cloud tornado",
+ "dust/sand", "squall", "sand storm", "dust storm"};
+
+
+ if (data == NULL) {
+ strncpy(p, "Error reading weather data", p_max_size);
+ } else {
+ if (strcmp(obj->data.weather.data_type, "last_update") == EQUAL) {
+ strncpy(p, data->lastupd, p_max_size);
+ } else if (strcmp(obj->data.weather.data_type, "temperature_C") == EQUAL) {
+ snprintf(p, p_max_size, "%d", data->tmpC);
+ } else if (strcmp(obj->data.weather.data_type, "temperature_F") == EQUAL) {
+ snprintf(p, p_max_size, "%d", data->tmpF);
+ } else if (strcmp(obj->data.weather.data_type, "cloud_cover") == EQUAL) {
+ if (data->cc == 0) {
+ strncpy(p, "", p_max_size);
+ } else if (data->cc < 3) {
+ strncpy(p, "clear", p_max_size);
+ } else if (data->cc < 5) {
+ strncpy(p, "partly cloudy", p_max_size);
+ } else if (data->cc == 5) {
+ strncpy(p, "cloudy", p_max_size);
+ } else if (data->cc == 6) {
+ strncpy(p, "overcast", p_max_size);
+ } else if (data->cc == 7) {
+ strncpy(p, "towering cumulus", p_max_size);
+ } else {
+ strncpy(p, "cumulonimbus", p_max_size);
+ }
+ } else if (strcmp(obj->data.weather.data_type, "pressure") == EQUAL) {
+ snprintf(p, p_max_size, "%d", data->bar);
+ } else if (strcmp(obj->data.weather.data_type, "wind_speed") == EQUAL) {
+ snprintf(p, p_max_size, "%d", data->wind_s);
+ } else if (strcmp(obj->data.weather.data_type, "wind_dir") == EQUAL) {
+ if ((data->wind_d >= 349) || (data->wind_d < 12)) {
+ strncpy(p, "N", p_max_size);
+ } else if (data->wind_d < 33) {
+ strncpy(p, "NNE", p_max_size);
+ } else if (data->wind_d < 57) {
+ strncpy(p, "NE", p_max_size);
+ } else if (data->wind_d < 79) {
+ strncpy(p, "ENE", p_max_size);
+ } else if (data->wind_d < 102) {
+ strncpy(p, "E", p_max_size);
+ } else if (data->wind_d < 124) {
+ strncpy(p, "ESE", p_max_size);
+ } else if (data->wind_d < 147) {
+ strncpy(p, "SE", p_max_size);
+ } else if (data->wind_d < 169) {
+ strncpy(p, "SSE", p_max_size);
+ } else if (data->wind_d < 192) {
+ strncpy(p, "S", p_max_size);
+ } else if (data->wind_d < 214) {
+ strncpy(p, "SSW", p_max_size);
+ } else if (data->wind_d < 237) {
+ strncpy(p, "SW", p_max_size);
+ } else if (data->wind_d < 259) {
+ strncpy(p, "WSW", p_max_size);
+ } else if (data->wind_d < 282) {
+ strncpy(p, "W", p_max_size);
+ } else if (data->wind_d < 304) {
+ strncpy(p, "WNW", p_max_size);
+ } else if (data->wind_d < 327) {
+ strncpy(p, "NW", p_max_size);
+ } else if (data->wind_d < 349) {
+ strncpy(p, "NNW", p_max_size);
+ };
+ } else if (strcmp(obj->data.weather.data_type, "wind_dir_DEG") == EQUAL) {
+ snprintf(p, p_max_size, "%d", data->wind_d);
+
+ } else if (strcmp(obj->data.weather.data_type, "humidity") == EQUAL) {
+ snprintf(p, p_max_size, "%d", data->hmid);
+ } else if (strcmp(obj->data.weather.data_type, "weather") == EQUAL) {
+ strncpy(p, wc[data->wc], p_max_size);
+ }
+ }
}
#endif
#ifdef HAVE_LUA
OBJ(lua_parse) {
char *str = llua_getstring(obj->data.s);
if (str) {
- struct information *tmp_info;
- struct text_object subroot;
-
- tmp_info = malloc(sizeof(struct information));
- memcpy(tmp_info, cur, sizeof(struct information));
- parse_conky_vars(&subroot, str, p, tmp_info);
-
- free_text_objects(&subroot, 1);
- free(tmp_info);
- free(str);
+ evaluate(str, p);
}
}
- OBJ(lua_read_parse) {
- struct information *tmp_info;
- struct text_object subroot, subroot2;
- char func[64];
- char *text, *str;
- sscanf(obj->data.s, "%64s", func);
- text = obj->data.s + strlen(func) + 1;
-
- tmp_info = malloc(sizeof(struct information));
- memcpy(tmp_info, cur, sizeof(struct information));
- parse_conky_vars(&subroot, text, p, tmp_info);
- DBGP("evaluated '%s' to '%s'", text, p);
-
- str = llua_getstring_read(func, p);
- if (str) {
- parse_conky_vars(&subroot2, str, p, tmp_info);
- DBGP("evaluated '%s' to '%s'", str, p);
-
- free(str);
- free_text_objects(&subroot2, 1);
- }
- free_text_objects(&subroot, 1);
- free(tmp_info);
- }
OBJ(lua_bar) {
double per;
if (llua_getnumber(obj->data.s, &per)) {
#endif /* X11 */
}
+void evaluate(char *text, char *buffer)
+{
+ struct information *tmp_info;
+ struct text_object subroot;
+
+ tmp_info = malloc(sizeof(struct information));
+ memcpy(tmp_info, &info, sizeof(struct information));
+ parse_conky_vars(&subroot, text, buffer, tmp_info);
+ DBGP("evaluated '%s' to '%s'", text, buffer);
+
+ free_text_objects(&subroot, 1);
+ free(tmp_info);
+}
+
double current_update_time, next_update_time, last_update_time;
static void generate_text(void)
if (own_window && !fixed_pos) {
x += workarea[0];
y += workarea[1];
- text_start_x = border_inner_margin + border_outer_margin + border_width;
- text_start_y = border_inner_margin + border_outer_margin + border_width;
- window.x = x - border_inner_margin - border_outer_margin - border_width;
- window.y = y - border_inner_margin - border_outer_margin - border_width;
+ text_start_x = window.border_inner_margin + window.border_outer_margin + window.border_width;
+ text_start_y = window.border_inner_margin + window.border_outer_margin + window.border_width;
+ window.x = x - window.border_inner_margin - window.border_outer_margin - window.border_width;
+ window.y = y - window.border_inner_margin - window.border_outer_margin - window.border_width;
} else
#endif
{
text_start_x = x;
text_start_y = y;
}
+#ifdef HAVE_LUA
+ /* update lua window globals */
+ llua_update_window_table(text_start_x, text_start_y, text_width, text_height);
+#endif /* HAVE_LUA */
}
/* drawing stuff */
case ALIGNR:
{
- /* TODO: add back in "+ border_inner_margin" to the end of
+ /* TODO: add back in "+ window.border_inner_margin" to the end of
* this line? */
int pos_x = text_start_x + text_width -
get_string_width_special(s);
/* printf("pos_x %i text_start_x %i text_width %i cur_x %i "
"get_string_width(p) %i gap_x %i "
- "specials[special_index].arg %i border_inner_margin %i "
- "border_width %i\n", pos_x, text_start_x, text_width,
+ "specials[special_index].arg %i window.border_inner_margin %i "
+ "window.border_width %i\n", pos_x, text_start_x, text_width,
cur_x, get_string_width_special(s), gap_x,
- specials[special_index].arg, border_inner_margin,
- border_width); */
+ specials[special_index].arg, window.border_inner_margin,
+ window.border_width); */
if (pos_x > specials[special_index].arg && pos_x > cur_x) {
cur_x = pos_x - specials[special_index].arg;
}
static void draw_text(void)
{
#ifdef X11
+#ifdef HAVE_LUA
+ llua_draw_pre_hook();
+#endif /* HAVE_LUA */
if (output_methods & TO_X) {
cur_y = text_start_y;
/* draw borders */
- if (draw_borders && border_width > 0) {
+ if (draw_borders && window.border_width > 0) {
if (stippled_borders) {
char ss[2] = { stippled_borders, stippled_borders };
- XSetLineAttributes(display, window.gc, border_width, LineOnOffDash,
+ XSetLineAttributes(display, window.gc, window.border_width, LineOnOffDash,
CapButt, JoinMiter);
XSetDashes(display, window.gc, 0, ss, 2);
} else {
- XSetLineAttributes(display, window.gc, border_width, LineSolid,
+ XSetLineAttributes(display, window.gc, window.border_width, LineSolid,
CapButt, JoinMiter);
}
XDrawRectangle(display, window.drawable, window.gc,
- text_start_x - border_inner_margin - border_width,
- text_start_y - border_inner_margin - border_width,
- text_width + border_inner_margin * 2 + border_width * 2,
- text_height + border_inner_margin * 2 + border_width * 2);
+ text_start_x - window.border_inner_margin - window.border_width,
+ text_start_y - window.border_inner_margin - window.border_width,
+ text_width + window.border_inner_margin * 2 + window.border_width * 2,
+ text_height + window.border_inner_margin * 2 + window.border_width * 2);
}
/* draw text */
setup_fonts();
#endif /* X11 */
for_each_line(text_buffer, draw_line);
+#if defined(HAVE_LUA) && defined(X11)
+ llua_draw_post_hook();
+#endif /* HAVE_LUA */
}
static void draw_stuff(void)
#endif
if (display && window.window) { // make sure these are !null
/* there is some extra space for borders and outlines */
- XClearArea(display, window.window, text_start_x - border_inner_margin - border_outer_margin - border_width,
- text_start_y - border_inner_margin - border_outer_margin - border_width,
- text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2,
- text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2, exposures ? True : 0);
+ XClearArea(display, window.window, text_start_x - window.border_inner_margin - window.border_outer_margin - window.border_width,
+ text_start_y - window.border_inner_margin - window.border_outer_margin - window.border_width,
+ text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2,
+ text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2, exposures ? True : 0);
}
}
#endif /* X11 */
/* resize window if it isn't right size */
if (!fixed_size
- && (text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2 != window.width
- || text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2 != window.height)) {
- window.width = text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2;
- window.height = text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2;
+ && (text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2 != window.width
+ || text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2 != window.height)) {
+ window.width = text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2;
+ window.height = text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2;
XResizeWindow(display, window.window, window.width,
window.height);
set_transparent_background(window.window);
if (use_xdbe) {
XRectangle r;
- r.x = text_start_x - border_inner_margin - border_outer_margin - border_width;
- r.y = text_start_y - border_inner_margin - border_outer_margin - border_width;
- r.width = text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2;
- r.height = text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2;
+ r.x = text_start_x - window.border_inner_margin - window.border_outer_margin - window.border_width;
+ r.y = text_start_y - window.border_inner_margin - window.border_outer_margin - window.border_width;
+ r.width = text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2;
+ r.height = text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2;
XUnionRectWithRegion(&r, x11_stuff.region, x11_stuff.region);
}
#endif
}
}
- text_width = window.width - border_inner_margin * 2 - border_outer_margin * 2 - border_width * 2;
- text_height = window.height - border_inner_margin * 2 - border_outer_margin * 2 - border_width * 2;
+ text_width = window.width - window.border_inner_margin * 2 - window.border_outer_margin * 2 - window.border_width * 2;
+ text_height = window.height - window.border_inner_margin * 2 - window.border_outer_margin * 2 - window.border_width * 2;
if (text_width > maximum_width
&& maximum_width > 0) {
text_width = maximum_width;
if (use_xdbe) {
XRectangle r;
- r.x = text_start_x - border_inner_margin - border_outer_margin - border_width;
- r.y = text_start_y - border_inner_margin - border_outer_margin - border_width;
- r.width = text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2;
- r.height = text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2;
+ r.x = text_start_x - window.border_inner_margin - window.border_outer_margin - window.border_width;
+ r.y = text_start_y - window.border_inner_margin - window.border_outer_margin - window.border_width;
+ r.width = text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2;
+ r.height = text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2;
XUnionRectWithRegion(&r, x11_stuff.region, x11_stuff.region);
}
#endif
sprintf(window.title, PACKAGE_NAME" (%s)", info.uname_s.nodename);
#endif
stippled_borders = 0;
- border_inner_margin = 3;
- border_outer_margin = 1;
- border_width = 1;
+ window.border_inner_margin = 3;
+ window.border_outer_margin = 1;
+ window.border_width = 1;
text_alignment = BOTTOM_LEFT;
info.x11.monitor.number = 1;
info.x11.monitor.current = 0;
{
if (output_methods & TO_X) {
#ifdef OWN_WINDOW
- init_window(own_window, text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2,
- text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2, set_transparent, background_colour,
+ init_window(own_window, text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2,
+ text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2, set_transparent, background_colour,
xargv, xargc);
#else /* OWN_WINDOW */
- init_window(0, text_width + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2,
- text_height + border_inner_margin * 2 + border_outer_margin * 2 + border_width * 2, set_transparent, 0,
+ init_window(0, text_width + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2,
+ text_height + window.border_inner_margin * 2 + window.border_outer_margin * 2 + window.border_width * 2, set_transparent, 0,
xargv, xargc);
#endif /* OWN_WINDOW */
selected_font = 0;
update_text_area(); /* to get initial size of the window */
}
+#ifdef HAVE_LUA
+ /* setup lua window globals */
+ llua_setup_window_table(text_start_x, text_start_y, text_width, text_height);
+#endif /* HAVE_LUA */
}
#endif /* X11 */
show_graph_range = string_to_bool(value);
}
CONF("border_margin") {
- ERR("border_margin is deprecated, please use border_inner_margin instead");
+ ERR("border_margin is deprecated, please use window.border_inner_margin instead");
if (value) {
- border_inner_margin = strtol(value, 0, 0);
- if (border_inner_margin < 0) border_inner_margin = 0;
+ window.border_inner_margin = strtol(value, 0, 0);
+ if (window.border_inner_margin < 0) window.border_inner_margin = 0;
} else {
CONF_ERR;
}
}
CONF("border_inner_margin") {
if (value) {
- border_inner_margin = strtol(value, 0, 0);
- if (border_inner_margin < 0) border_inner_margin = 0;
+ window.border_inner_margin = strtol(value, 0, 0);
+ if (window.border_inner_margin < 0) window.border_inner_margin = 0;
} else {
CONF_ERR;
}
}
CONF("border_outer_margin") {
if (value) {
- border_outer_margin = strtol(value, 0, 0);
- if (border_outer_margin < 0) border_outer_margin = 0;
+ window.border_outer_margin = strtol(value, 0, 0);
+ if (window.border_outer_margin < 0) window.border_outer_margin = 0;
} else {
CONF_ERR;
}
}
CONF("border_width") {
if (value) {
- border_width = strtol(value, 0, 0);
- if (border_width < 0) border_width = 0;
+ window.border_width = strtol(value, 0, 0);
+ if (window.border_width < 0) window.border_width = 0;
} else {
CONF_ERR;
}
}
#ifdef HAVE_LUA
CONF("lua_load") {
- llua_init();
- if(value) {
+ if (value) {
char *ptr = strtok(value, " ");
- while(ptr) {
+ while (ptr) {
llua_load(ptr);
ptr = strtok(NULL, " ");
}
CONF_ERR;
}
}
+#ifdef X11
+ CONF("lua_draw_hook_pre") {
+ if (value) {
+ llua_set_draw_pre_hook(value);
+ } else {
+ CONF_ERR;
+ }
+ }
+ CONF("lua_draw_hook_post") {
+ if (value) {
+ llua_set_draw_post_hook(value);
+ } else {
+ CONF_ERR;
+ }
+ }
+#endif /* X11 */
#endif /* HAVE_LUA */
CONF("color0"){}
struct sigaction act, oact;
g_signal_pending = 0;
+ max_user_text = MAX_USER_TEXT_DEFAULT;
+ current_config = 0;
memset(&info, 0, sizeof(info));
memset(template, 0, sizeof(template));
clear_net_stats();
__attribute__((format(printf, 3, 5)));
extern int inotify_fd;
+/* defined in conky.c
+ * evaluates 'text' and places the result in 'buffer'
+ */
+void evaluate(char *text, char *buffer);
+
+/* maximum size of config TEXT buffer, i.e. below TEXT line. */
+extern unsigned int max_user_text;
+
+/* path to config file */
+extern char *current_config;
+
#ifdef X11
#define TO_X 1
#endif
image_list_start = image_list_end = NULL;
}
-void cimlib_init(Display *display, Window drawable, Visual *visual, Colormap colourmap)
+void cimlib_init(Display *disp, Window drawable, Visual *visual, Colormap colourmap)
{
image_list_start = image_list_end = NULL;
if (!cache_size_set) cimlib_set_cache_size(DEFAULT_IMLIB2_CACHE_SIZE);
/* dither for depths < 24bpp */
imlib_context_set_dither(1);
/* set the display , visual, colormap and drawable we are using */
- imlib_context_set_display(display);
+ imlib_context_set_display(disp);
imlib_context_set_visual(visual);
imlib_context_set_colormap(colourmap);
imlib_context_set_drawable(drawable);
#include "conky.h"
#include "logging.h"
+#include "build.h"
#ifdef HAVE_SYS_INOTIFY_H
#include <sys/inotify.h>
static int llua_block_notify = 0;
#endif /* HAVE_SYS_INOTIFY_H */
+static char *draw_pre = 0;
+static char *draw_post = 0;
+
lua_State *lua_L = NULL;
+static int llua_conky_parse(lua_State *L)
+{
+ int n = lua_gettop(L); /* number of arguments */
+ char *str;
+ char *buf = calloc(1, max_user_text);
+ if (n != 1) {
+ lua_pushstring(L, "incorrect arguments, conky_parse(string) takes exactly 1 argument");
+ lua_error(L);
+ }
+ if (!lua_isstring(L, 1)) {
+ lua_pushstring(L, "incorrect argument (expecting a string)");
+ lua_error(L);
+ }
+ str = strdup(lua_tostring(L, 1));
+ evaluate(str, buf);
+ lua_pushstring(L, buf);
+ free(str);
+ free(buf);
+ return 1; /* number of results */
+}
+
void llua_init(void)
{
- if(lua_L) return;
+ const char *libs = PACKAGE_LIBDIR"/lib?.so;";
+ char *old_path, *new_path;
+ if (lua_L) return;
lua_L = lua_open();
+
+ /* add our library path to the lua package.cpath global var */
luaL_openlibs(lua_L);
+ lua_getglobal(lua_L, "package");
+ lua_getfield(lua_L, -1, "cpath");
+ old_path = strdup(lua_tostring(lua_L, -1));
+ new_path = malloc(strlen(old_path) + strlen(libs) + 1);
+ strcpy(new_path, libs);
+ strcat(new_path, old_path);
+ lua_pushstring(lua_L, new_path);
+ lua_setfield(lua_L, -3, "cpath");
+ lua_pop(lua_L, 2);
+ free(old_path);
+ free(new_path);
+
+ lua_pushstring(lua_L, PACKAGE_NAME" "VERSION" compiled "BUILD_DATE" for "BUILD_ARCH);
+ lua_setglobal(lua_L, "conky_build_info");
+
+ lua_pushstring(lua_L, VERSION);
+ lua_setglobal(lua_L, "conky_version");
+
+ lua_pushstring(lua_L, current_config);
+ lua_setglobal(lua_L, "conky_config");
+
+ lua_pushcfunction(lua_L, &llua_conky_parse);
+ lua_setglobal(lua_L, "conky_parse");
}
void llua_load(const char *script)
int error;
char path[DEFAULT_TEXT_BUFFER_SIZE];
- if(!lua_L) return;
+ llua_init();
to_real_path(path, script);
error = luaL_dofile(lua_L, path);
char *ptr = strtok(tmp, " ");
/* proceed only if the function name is present */
- if(!ptr) {
+ if (!ptr) {
free(tmp);
return NULL;
}
/* parse all function parameters from args and push them to the stack */
ptr = strtok(NULL, " ");
- while(ptr) {
+ while (ptr) {
lua_pushstring(lua_L, ptr);
ptr = strtok(NULL, " ");
argc++;
if(!lua_L) return NULL;
func = llua_do_call(args, 1);
- if(func) {
- if(!lua_isstring(lua_L, -1)) {
+ if (func) {
+ if (!lua_isstring(lua_L, -1)) {
ERR("llua_getstring: function %s didn't return a string, result discarded", func);
} else {
ret = strdup(lua_tostring(lua_L, -1));
#ifdef HAVE_SYS_INOTIFY_H
llua_rm_notifies();
#endif /* HAVE_SYS_INOTIFY_H */
+ if (draw_pre) {
+ free(draw_pre);
+ draw_pre = 0;
+ }
+ if (draw_post) {
+ free(draw_post);
+ draw_post = 0;
+ }
if(!lua_L) return;
lua_close(lua_L);
lua_L = NULL;
}
#endif /* HAVE_SYS_INOTIFY_H */
+void llua_draw_pre_hook(void)
+{
+ if (!lua_L || !draw_pre) return;
+ llua_do_call(draw_pre, 0);
+}
+
+void llua_draw_post_hook(void)
+{
+ if (!lua_L || !draw_post) return;
+ llua_do_call(draw_post, 0);
+}
+
+void llua_set_draw_pre_hook(const char *args)
+{
+ draw_pre = strdup(args);
+}
+
+void llua_set_draw_post_hook(const char *args)
+{
+ draw_post = strdup(args);
+}
+
+void llua_set_long(const char *key, long value)
+{
+ lua_pushnumber(lua_L, value);
+ lua_setfield(lua_L, -2, key);
+}
+
+/* this function mostly copied from tolua++ source so that we could play nice
+ * with tolua++ libs. tolua++ is provided 'as is'
+ */
+void llua_set_userdata(const char *key, const char *type, void *value)
+{
+ if (value == NULL) {
+ lua_pushnil(lua_L);
+ } else {
+ luaL_getmetatable(lua_L, type);
+ lua_pushstring(lua_L,"tolua_ubox");
+ lua_rawget(lua_L,-2); /* stack: mt ubox */
+ if (lua_isnil(lua_L, -1)) {
+ lua_pop(lua_L, 1);
+ lua_pushstring(lua_L, "tolua_ubox");
+ lua_rawget(lua_L, LUA_REGISTRYINDEX);
+ }
+ lua_pushlightuserdata(lua_L,value);
+ lua_rawget(lua_L,-2); /* stack: mt ubox ubox[u] */
+ if (lua_isnil(lua_L,-1)) {
+ lua_pop(lua_L,1); /* stack: mt ubox */
+ lua_pushlightuserdata(lua_L,value);
+ *(void**)lua_newuserdata(lua_L,sizeof(void *)) = value; /* stack: mt ubox u newud */
+ lua_pushvalue(lua_L,-1); /* stack: mt ubox u newud newud */
+ lua_insert(lua_L,-4); /* stack: mt newud ubox u newud */
+ lua_rawset(lua_L,-3); /* stack: mt newud ubox */
+ lua_pop(lua_L,1); /* stack: mt newud */
+ /*luaL_getmetatable(lua_L,type);*/
+ lua_pushvalue(lua_L, -2); /* stack: mt newud mt */
+ lua_setmetatable(lua_L,-2); /* stack: mt newud */
+
+ } else {
+ /* check the need of updating the metatable to a more specialized class */
+ lua_insert(lua_L,-2); /* stack: mt ubox[u] ubox */
+ lua_pop(lua_L,1); /* stack: mt ubox[u] */
+ lua_pushstring(lua_L,"tolua_super");
+ lua_rawget(lua_L,LUA_REGISTRYINDEX); /* stack: mt ubox[u] super */
+ lua_getmetatable(lua_L,-2); /* stack: mt ubox[u] super mt */
+ lua_rawget(lua_L,-2); /* stack: mt ubox[u] super super[mt] */
+ if (lua_istable(lua_L,-1)) {
+ lua_pushstring(lua_L,type); /* stack: mt ubox[u] super super[mt] type */
+ lua_rawget(lua_L,-2); /* stack: mt ubox[u] super super[mt] flag */
+ if (lua_toboolean(lua_L,-1) == 1) {
+ /* if true */
+ lua_pop(lua_L,3); /* mt ubox[u]*/
+ lua_remove(lua_L, -2);
+ return;
+ }
+ }
+ /* type represents a more specilized type */
+ /*luaL_getmetatable(lua_L,type); // stack: mt ubox[u] super super[mt] flag mt */
+ lua_pushvalue(lua_L, -5); /* stack: mt ubox[u] super super[mt] flag mt */
+ lua_setmetatable(lua_L,-5); /* stack: mt ubox[u] super super[mt] flag */
+ lua_pop(lua_L,3); /* stack: mt ubox[u] */
+ }
+ lua_remove(lua_L, -2); /* stack: ubox[u]*/
+ }
+ lua_setfield(lua_L, -2, key);
+}
+
+void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height)
+{
+ lua_newtable(lua_L);
+
+ llua_set_userdata("drawable", "Drawable", (void*)&window.drawable);
+ llua_set_userdata("visual", "Visual", window.visual);
+ llua_set_userdata("display", "Display", display);
+
+ llua_set_long("width", window.width);
+ llua_set_long("height", window.height);
+ llua_set_long("border_inner_margin", window.border_inner_margin);
+ llua_set_long("border_outer_margin", window.border_outer_margin);
+ llua_set_long("border_width", window.border_width);
+
+ llua_set_long("text_start_x", text_start_x);
+ llua_set_long("text_start_y", text_start_y);
+ llua_set_long("text_width", text_width);
+ llua_set_long("text_height", text_height);
+
+ lua_setglobal(lua_L, "conky_window");
+}
+
+void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height)
+{
+ lua_getglobal(lua_L, "conky_window");
+ if (lua_isnil(lua_L, -1)) {
+ /* window table isn't populated yet */
+ return;
+ }
+
+ llua_set_long("width", window.width);
+ llua_set_long("height", window.height);
+
+ llua_set_long("text_start_x", text_start_x);
+ llua_set_long("text_start_y", text_start_y);
+ llua_set_long("text_width", text_width);
+ llua_set_long("text_height", text_height);
+
+ lua_setglobal(lua_L, "conky_window");
+}
+
#include <lauxlib.h>
#include <lualib.h>
-/* initialize lua stuff */
-void llua_init(void);
+#include "config.h"
+
+#ifdef X11
+#include "x11.h"
+#endif /* X11 */
+
/* load a lua script */
void llua_load(const char *script);
/* call a function with args, and return a string from it (must be free'd) */
void llua_inotify_query(int wd, int mask);
#endif /* HAVE_SYS_INOTIFY_H */
+#ifdef X11
+void llua_draw_pre_hook(void);
+void llua_draw_post_hook(void);
+void llua_set_draw_pre_hook(const char *args);
+void llua_set_draw_post_hook(const char *args);
+
+void llua_setup_window_table(int text_start_x, int text_start_y, int text_width, int text_height);
+void llua_update_window_table(int text_start_x, int text_start_y, int text_width, int text_height);
+#endif /* X11 */
+
#endif /* LUA_H_*/
return 1;
buf = strdup(name);
- #ifdef HAVE_OPENMP
- #pragma omp parallel for
- #endif /* HAVE_OPENMP */
for (i = 0; i < (long)strlen(name); i++)
buf[i] = tolower(name[i]);
#ifdef HAVE_LUA
OBJ_lua,
OBJ_lua_parse,
- OBJ_lua_read_parse,
OBJ_lua_bar,
#ifdef X11
OBJ_lua_graph,
fprintf(stderr, PACKAGE_NAME": drawing to single buffer\n");
}
#endif
+ window.visual = DefaultVisual(display, DefaultScreen(display));
+ window.colourmap = DefaultColormap(display, DefaultScreen(display));
#ifdef IMLIB2
{
- Visual *visual;
- Colormap colourmap;
- visual = DefaultVisual(display, DefaultScreen(display));
- colourmap = DefaultColormap(display, DefaultScreen(display));
- cimlib_init(display, window.drawable, visual, colourmap);
+ cimlib_init(display, window.drawable, window.visual, window.colourmap);
}
#endif /* IMLIB2 */
XFlush(display);
struct conky_window {
Window root, window, desktop;
Drawable drawable;
+ Visual *visual;
+ Colormap colourmap;
GC gc;
+ long border_inner_margin, border_outer_margin, border_width;
+
#ifdef HAVE_XDBE
XdbeBackBuffer back_buffer;
#endif