diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-01-15 05:06:48 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-01-15 05:06:48 +0800 |
commit | 7ee5680874383d1d111ae3cd3dec10c5b4111385 (patch) | |
tree | 6dfe29c741753a421ba1f8a6153576968d0241df | |
parent | d9c3fe17a3c1595fdf4ae850a03efc093cac8aea (diff) | |
download | gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.tar gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.tar.gz gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.tar.bz2 gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.tar.lz gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.tar.xz gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.tar.zst gsoc2013-epiphany-7ee5680874383d1d111ae3cd3dec10c5b4111385.zip |
Add defines and automake conditional for toolkit flavour.
2006-01-14 Christian Persch <chpe@cvs.gnome.org>
* m4/gecko.m4:
Add defines and automake conditional for toolkit flavour.
* configure.ac:
* data/Makefile.am:
A data/chrome/.cvsignore:
A data/chrome/Makefile.am:
A data/chrome/brand.dtd.in:
A data/chrome/brand.properties.in:
A data/chrome/epiphany.manifest.in:
Provide branding so mozilla dialogues don't show "Deer Park" or
"Firefox" but "Epiphany" instead.
* embed/mozilla/Makefile.am:
A embed/mozilla/EphyDirectoryProvider.cpp:
A embed/mozilla/EphyDirectoryProvider.h:
* embed/mozilla/mozilla-embed-single.cpp:
Add a directory service provider.
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | data/Makefile.am | 2 | ||||
-rw-r--r-- | data/chrome/.cvsignore | 5 | ||||
-rw-r--r-- | data/chrome/Makefile.am | 16 | ||||
-rw-r--r-- | data/chrome/brand.dtd.in | 5 | ||||
-rw-r--r-- | data/chrome/brand.properties.in | 3 | ||||
-rw-r--r-- | data/chrome/epiphany.manifest.in | 2 | ||||
-rw-r--r-- | embed/mozilla/EphyDirectoryProvider.cpp | 100 | ||||
-rw-r--r-- | embed/mozilla/EphyDirectoryProvider.h | 37 | ||||
-rw-r--r-- | embed/mozilla/Makefile.am | 7 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 19 | ||||
-rw-r--r-- | m4/gecko.m4 | 6 |
13 files changed, 228 insertions, 1 deletions
@@ -1,3 +1,27 @@ +2006-01-14 Christian Persch <chpe@cvs.gnome.org> + + * m4/gecko.m4: + + Add defines and automake conditional for toolkit flavour. + + * configure.ac: + * data/Makefile.am: + A data/chrome/.cvsignore: + A data/chrome/Makefile.am: + A data/chrome/brand.dtd.in: + A data/chrome/brand.properties.in: + A data/chrome/epiphany.manifest.in: + + Provide branding so mozilla dialogues don't show "Deer Park" or + "Firefox" but "Epiphany" instead. + + * embed/mozilla/Makefile.am: + A embed/mozilla/EphyDirectoryProvider.cpp: + A embed/mozilla/EphyDirectoryProvider.h: + * embed/mozilla/mozilla-embed-single.cpp: + + Add a directory service provider. + 2006-01-13 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-stock-icons.c: diff --git a/configure.ac b/configure.ac index bdcedf332..074089a5e 100644 --- a/configure.ac +++ b/configure.ac @@ -630,6 +630,9 @@ data/Makefile data/epiphany-${EPIPHANY_API_VERSION}.pc:data/epiphany.pc.in data/epiphany.desktop.in data/bme.desktop.in +data/chrome/Makefile +data/chrome/brand.dtd +data/chrome/brand.properties data/glade/Makefile data/art/Makefile data/ui/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index da5064239..d965591de 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = ui art glade +SUBDIRS = art chrome glade ui @INTLTOOL_SERVER_RULE@ @INTLTOOL_DESKTOP_RULE@ diff --git a/data/chrome/.cvsignore b/data/chrome/.cvsignore new file mode 100644 index 000000000..81c7ee303 --- /dev/null +++ b/data/chrome/.cvsignore @@ -0,0 +1,5 @@ +Makefile +Makefile.in +*.manifest +brand.dtd +brand.properties diff --git a/data/chrome/Makefile.am b/data/chrome/Makefile.am new file mode 100644 index 000000000..155e8aa83 --- /dev/null +++ b/data/chrome/Makefile.am @@ -0,0 +1,16 @@ +manifestdir = $(pkgdatadir)/chrome +manifest_in_files = epiphany.manifest.in +manifest_DATA = $(manifest_in_files:.manifest.in=.manifest) + +%.manifest: %.manifest.in + @sed -e "s!@CHROMEDIR@!$(pkgdatadir)/chrome!g" $< > $@ + +brandingdir = $(manifestdir)/branding +branding_in_files = \ + brand.dtd.in \ + brand.properties.in +branding_DATA = $(branding_in_files:%.in=%) + +EXTRA_DIST = \ + $(manifest_in_files) \ + $(branding_in_files) diff --git a/data/chrome/brand.dtd.in b/data/chrome/brand.dtd.in new file mode 100644 index 000000000..de0a39edc --- /dev/null +++ b/data/chrome/brand.dtd.in @@ -0,0 +1,5 @@ +<!ENTITY brandShortName "Epiphany"> +<!ENTITY brandFullName "Epiphany @VERSION@"> +<!ENTITY vendorShortName "GNOME"> + +<!ENTITY releaseURL "http://www.gnome.org/projects/epiphany/"> diff --git a/data/chrome/brand.properties.in b/data/chrome/brand.properties.in new file mode 100644 index 000000000..8a641ce08 --- /dev/null +++ b/data/chrome/brand.properties.in @@ -0,0 +1,3 @@ +brandShortName=Epiphany +brandFullName=Epiphany @VERSION@ +vendorShortName=GNOME diff --git a/data/chrome/epiphany.manifest.in b/data/chrome/epiphany.manifest.in new file mode 100644 index 000000000..3f8eb3a2c --- /dev/null +++ b/data/chrome/epiphany.manifest.in @@ -0,0 +1,2 @@ +override chrome://branding/locale/brand.properties file://@CHROMEDIR@/branding/brand.properties +override chrome://branding/locale/brand.dtd file://@CHROMEDIR@/branding/brand.dtd diff --git a/embed/mozilla/EphyDirectoryProvider.cpp b/embed/mozilla/EphyDirectoryProvider.cpp new file mode 100644 index 000000000..1c9e30b4d --- /dev/null +++ b/embed/mozilla/EphyDirectoryProvider.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2006 Christian Persch + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1, 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 Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#include "mozilla-config.h" + +#include "config.h" + +#include "EphyDirectoryProvider.h" + +#include <nsCOMPtr.h> +#include <nsIIOService.h> +#include <nsNetUtil.h> +#include <nsEnumeratorUtils.h> +#include <nsILocalFile.h> +#include <nsAppDirectoryServiceDefs.h> +#include <nsIToolkitChromeRegistry.h> +#include <nsIDirectoryService.h> +#include <nsISupportsArray.h> + +#include <string.h> + +NS_IMPL_ISUPPORTS2 (EphyDirectoryProvider, + nsIDirectoryServiceProvider, + nsIDirectoryServiceProvider2) + + +/* nsIFile getFile (in string prop, out PRBool persistent); */ +NS_IMETHODIMP +EphyDirectoryProvider::GetFile (const char *prop, + PRBool *persistent, + nsIFile **_retval) +{ + return NS_ERROR_FAILURE; +} + +/* nsISimpleEnumerator getFiles (in string prop); */ +NS_IMETHODIMP +EphyDirectoryProvider::GetFiles (const char *prop, + nsISimpleEnumerator **_retval) +{ + nsresult rv = NS_ERROR_FAILURE; + + if (prop && strcmp (prop, NS_CHROME_MANIFESTS_FILE_LIST) == 0) + { + nsCOMPtr<nsILocalFile> manifestDir; + rv = NS_NewNativeLocalFile (nsDependentCString(SHARE_DIR "/chrome"), PR_TRUE, + getter_AddRefs (manifestDir)); + NS_ENSURE_SUCCESS (rv, rv); + + nsCOMPtr<nsISupports> element (do_QueryInterface (manifestDir, &rv)); + NS_ENSURE_SUCCESS (rv, rv); + + /* FIXME: this sucks! + * When we don't implement a directory service provider, + * the chrome registry takes its manifests files from the + * app chrome dir; but it doesn't append this dir when + * we do provide our own (additional) chrome manifest dirs! + * http://lxr.mozilla.org/seamonkey/source/chrome/src/nsChromeRegistry.cpp#1147 + */ + nsCOMPtr<nsIProperties> dirServ (do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv)); + NS_ENSURE_SUCCESS (rv, rv); + + nsCOMPtr<nsIFile> chromeDir; + rv = dirServ->Get (NS_APP_CHROME_DIR, NS_GET_IID (nsIFile), + getter_AddRefs (chromeDir)); + NS_ENSURE_SUCCESS (rv, rv); + + nsCOMPtr<nsISupportsArray> array; + rv = NS_NewISupportsArray (getter_AddRefs (array)); + NS_ENSURE_SUCCESS (rv, rv); + + rv = array->AppendElement (manifestDir); + rv |= array->AppendElement (chromeDir); + NS_ENSURE_SUCCESS (rv, rv); + + rv = NS_NewArrayEnumerator (_retval, array); + NS_ENSURE_SUCCESS (rv, rv); + + rv = NS_SUCCESS_AGGREGATE_RESULT; + } + + return rv; +} diff --git a/embed/mozilla/EphyDirectoryProvider.h b/embed/mozilla/EphyDirectoryProvider.h new file mode 100644 index 000000000..9c0a5b9d5 --- /dev/null +++ b/embed/mozilla/EphyDirectoryProvider.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2006 Christian Persch + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1, 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 Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifndef EPHY_DIRECTORY_PROVIDER_H +#define EPHY_DIRECTORY_PROVIDER_H + +#include <nsIDirectoryService.h> + +class EphyDirectoryProvider : public nsIDirectoryServiceProvider2 +{ + public: + NS_DECL_ISUPPORTS + NS_DECL_NSIDIRECTORYSERVICEPROVIDER + NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 + + EphyDirectoryProvider() { } + virtual ~EphyDirectoryProvider() { } +}; + +#endif /* EPHY_DIRECTORY_PROVIDER_H */ diff --git a/embed/mozilla/Makefile.am b/embed/mozilla/Makefile.am index 651ec27e7..3e7eced11 100644 --- a/embed/mozilla/Makefile.am +++ b/embed/mozilla/Makefile.am @@ -58,6 +58,12 @@ libephymozillaembed_la_SOURCES += \ FilePicker.h endif +if HAVE_MOZILLA_TOOLKIT +libephymozillaembed_la_SOURCES += \ + EphyDirectoryProvider.cpp \ + EphyDirectoryProvider.h +endif + if HAVE_MOZILLA_PSM libephymozillaembed_la_SOURCES += \ GtkNSSClientAuthDialogs.cpp \ @@ -85,6 +91,7 @@ endif mozilla_include_subdirs = \ caps \ chardet \ + chrome \ commandhandler \ content \ cookie \ diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 447f3b4ff..f0675d355 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -36,6 +36,7 @@ #include "glib.h" #include "ephy-debug.h" #include "gtkmozembed.h" +#include "gtkmozembed_internal.h" #include "mozilla-embed.h" #include "ephy-file-helpers.h" #include "mozilla-notifiers.h" @@ -72,6 +73,10 @@ #include <nsILocalFile.h> #include <nsIURI.h> +#ifdef HAVE_MOZILLA_TOOLKIT +#include "EphyDirectoryProvider.h" +#endif + #ifdef HAVE_MOZILLA_PSM #include <nsIX509Cert.h> #include <nsIX509CertDB.h> @@ -528,6 +533,20 @@ init_services (MozillaEmbedSingle *single) /* Set mozilla binary path */ gtk_moz_embed_set_comp_path (MOZILLA_HOME); +#ifdef HAVE_MOZILLA_TOOLKIT + EphyDirectoryProvider *dirProvider = new EphyDirectoryProvider (); + if (!dirProvider) return FALSE; + + NS_ADDREF (dirProvider); + nsCOMPtr<nsIDirectoryServiceProvider> dp (do_QueryInterface (dirProvider)); + NS_RELEASE (dirProvider); + + if (!dp) return FALSE; + + gtk_moz_embed_set_directory_service_provider (dp); + dp = nsnull; +#endif + /* Fire up the beast */ gtk_moz_embed_push_startup (); diff --git a/m4/gecko.m4 b/m4/gecko.m4 index 5f35e9a4c..22f95151f 100644 --- a/m4/gecko.m4 +++ b/m4/gecko.m4 @@ -94,6 +94,12 @@ _GECKO_PREFIX="`$PKG_CONFIG --variable=prefix ${gecko_cv_gecko}-gtkmozembed`" fi # if gecko_cv_have_gecko +if test "$gecko_cv_gecko_flavour" = "toolkit"; then + AC_DEFINE([HAVE_MOZILLA_TOOLKIT],[1],[Define if mozilla is of the toolkit flavour]) +fi + +AM_CONDITIONAL([HAVE_MOZILLA_TOOLKIT],[test "$gecko_cv_gecko_flavour" = "toolkit"]) + $1[]=$gecko_cv_gecko $1[]_FLAVOUR=$gecko_cv_gecko_flavour $1[]_INCLUDE_ROOT=$_GECKO_INCLUDE_ROOT |