[Fwd: Re: Enable/Disable a extension]



[David, apoligies that you get this twice, my last email was from the wrong email address]

David Sede�ern�ez wrote:
Hi,

I have develop a epiphany extension for gwget [1], and I have a couple
of question:

1) is there a way that a user can enable/disable a extension from
epiphany ? Or better say, can a extension put a option in epiphany to
disable itself ?

The next version of epiphany has the ability to enable / disable
extensions via a gconf key, it will almost certainly have a UI as a
frontend as well.

2) What it is the correct way to check epiphany development? I have put
this in my configure.in[2] PKG_CHECK_MODULES, but I only can check
epiphany 1.2 or 1.4. How can check epiphany >1.2 and work with 1.4 ?

EPIPHANY_REQUIRED=1.2

...
	epiphany-1.2 >= $EPIPHANY_REQUIRED,


I don't think there is an easy way, this is caused by the changing name
of the .pc file. IMO it would be better not to change its name, and have
an EPHY_CHCEK_VERSION() macro that would allow for API differences,
however in my extensions (http://patches.theflowerdays.com/extensions) I
have some code in the configure script to allow choosing the ephy version.

I've attached the relevant part of the configure script (it allows
choosing between 1.4 and 1.6, but is easy enough to change / extend)

Crispin


AC_MSG_CHECKING([which epiphany to use])

EPHY_VER=
AC_ARG_WITH([epiphany-version],
        AC_HELP_STRING([--with-epiphany-version@<:@=1.4|1.6@:>@],
                       [Whether to use epiphany version 1.4 or 1.6 (default 1.4)]),
        [EPHY_VER="$withval"])

dnl try to autodetect, 1.4 or 1.6
EPHY_AUTODETECT=
if test "x$EPHY_VER" = "x"; then
   EPHY_AUTODETECT="(autodetect)"
   if pkg-config --exists epiphany-1.4; then
        EPHY_VER=1.4
   elif pkg-config --exists epiphany-1.6; then
        EPHY_VER=1.6
   else
        AC_MSG_ERROR([no epiphany installation found])
  fi
fi

EPIPHANY_REQUIRED=
EPIPHANY_PKGCONFIG=

case $EPHY_VER in
     1.4)
          AC_DEFINE_UNQUOTED(EPHY_VERSION, 14, [Define to the Epiphany version (14 or 16)])
          EPIPHANY_PKGCONFIG=epiphany-1.4
          EPIPHANY_REQUIRED=1.4.0
          ;;
     1.6)
          AC_DEFINE_UNQUOTED(EPHY_VERSION, 16, [Define to the Epiphany version (14 or 16)])
          EPIPHANY_PKGCONFIG=epiphany-1.6
          EPIPHANY_REQUIRED=1.5.0
          ;;
     *)
        AC_MSG_ERROR([Invalid epiphany version specificed, expected 1.4 or 1.6])
esac

AC_MSG_RESULT([$EPHY_VER $EPHY_AUTODETECT])

LIBGLIB_REQUIRED=2.4.0
LIBGTK_REQUIRED=2.4.0

AC_SUBST(EPIPHANY_REQUIRED)
AC_SUBST(LIBGLIB_REQUIRED)
AC_SUBST(LIBGTK_REQUIRED)

PKG_CHECK_MODULES(EPIPHANY_DEPENDENCY, \
                  glib-2.0 >= $LIBGLIB_REQUIRED \
                  gmodule-2.0 \
                  gtk+-2.0 >= $LIBGTK_REQUIRED \
                  $EPIPHANY_PKGCONFIG >= $EPIPHANY_REQUIRED)
AC_SUBST(EPIPHANY_DEPENDENCY_CFLAGS)
AC_SUBST(EPIPHANY_DEPENDENCY_LIBS)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]