[Alsaplayer-devel] autotools issue and Madej's systray patch
Dominique Michel
dominique.michel at citycable.ch
Sun Nov 11 18:02:55 GMT 2007
Hi,
Madej send me a patch that add basic systray function into gtk2.
I don't want to force the user to compile it. For that, configure must check
about gtk+>=2.10 and I added a --enable-systray configure option.
I also made some change into a Makefile to conditionally compile the added
files, and it must be some kind of #ifdef in gtk_interface.cpp.
It is in that last file that I cannot get it to work.
Here is what I have done:
In configure.ac:
dnl ================
dnl GTK2 for systray
dnl ================
PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.10.0 gthread-2.0 >= 2.0.3 pango,
can_systray=yes, can_systray=no)
AC_ARG_ENABLE(systray,
[ --enable-systray Enable SysTray icon (default=no)],,
enable_systray=no)
if test "x$enable_systray" = xyes;
then
if test "$can_systray" = "yes"
then
have_systray=yes
else
have_systray=no
fi
else
have_systray=no
fi
AM_CONDITIONAL(HAVE_SYSTRAY,test "x$have_systray" = "xyes")
AC_DEFINE_UNQUOTED([HAVE_SYSTRAY], [$have_systray], [Define if systray code
must be compiled.])
if test "$enable_systray" = yes; then
if test "$have_systray" = no; then
echo Systray support need gtk+>=2.10.n
else
echo Experimental systray support will be compiled
fi
fi
#############
In interface/gtk2/Makefile.am:
if HAVE_SYSTRAY
gtk2_systraysources = StatusIcon.h StatusIcon.cpp
else
gtk2_systraysources =
endif
...
libgtk2_interface_la_SOURCES= $(gtk2_interfacesources) $(gtk2_systraysources)
#######################
In interface/gtk2/gtk_interface.cpp:
#if defined(HAVE_SYSTRAY) && HAVE_SYSTRAY == yes
#define COMP_SYSTRAY
#else
#undef COMP_SYSTRAY
#endif
This last change doesn't work as expected.
I also added some #ifdef around the Madej's changes:
#ifdef COMP_SYSTRAY
#include "StatusIcon.h"
#endif
...
#ifdef COMP_SYSTRAY
newcode
#else
oldcode
#endif
#########
Cheers,
Dominique
-------------- next part --------------
A non-text attachment was scrubbed...
Name: status.patch
Type: text/x-patch
Size: 6019 bytes
Desc: not available
Url : http://lists.tartarus.org/pipermail/alsaplayer-devel/attachments/20071111/ed3d9e3d/status.bin
More information about the alsaplayer-devel
mailing list