From c488b4e9aca045965156e425129a6be95637da98 Mon Sep 17 00:00:00 2001 From: Crispin Flowerday Date: Sun, 29 Jan 2006 21:09:53 +0000 Subject: Add a function (ephy_embed_single_get_backend_name) to get the backend 2006-01-29 Crispin Flowerday * embed/ephy-embed-single.c: (ephy_embed_single_get_backend_name): * embed/ephy-embed-single.h: * embed/mozilla/mozilla-embed-single.cpp: * src/epiphany.defs: Add a function (ephy_embed_single_get_backend_name) to get the backend that epiphany is using. --- ChangeLog | 10 ++++++++++ embed/ephy-embed-single.c | 17 +++++++++++++++++ embed/ephy-embed-single.h | 3 +++ embed/mozilla/mozilla-embed-single.cpp | 17 +++++++++++++++++ src/epiphany.defs | 6 +++++- 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c8fef0103..8e2414b02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-01-29 Crispin Flowerday + + * embed/ephy-embed-single.c: (ephy_embed_single_get_backend_name): + * embed/ephy-embed-single.h: + * embed/mozilla/mozilla-embed-single.cpp: + * src/epiphany.defs: + + Add a function (ephy_embed_single_get_backend_name) to get + the backend that epiphany is using. + 2006-01-29 Reinout van Schouwen * NEWS diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 33831f157..3cd07570c 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -289,3 +289,20 @@ ephy_embed_single_open_window (EphyEmbedSingle *single, EphyEmbedSingleIface *iface = EPHY_EMBED_SINGLE_GET_IFACE (single); return iface->open_window (single, parent, address, name, features); } + +/** + * ephy_embed_single_get_backend_name + * @single: the #EphyEmbedSingle + * + * Can be used to find the particular backend that is being used + * for rendering pages. + * + * Returns: the name of the backend. Valid returns are "gecko-1.7", + * "gecko-1.8" and "gecko-1.9" + */ +const char * +ephy_embed_single_get_backend_name (EphyEmbedSingle *single) +{ + EphyEmbedSingleIface *iface = EPHY_EMBED_SINGLE_GET_IFACE (single); + return iface->get_backend_name (single); +} diff --git a/embed/ephy-embed-single.h b/embed/ephy-embed-single.h index 0ff733e94..9e5dcd2bb 100644 --- a/embed/ephy-embed-single.h +++ b/embed/ephy-embed-single.h @@ -73,6 +73,7 @@ struct _EphyEmbedSingleIface gboolean (* get_network_status)(EphyEmbedSingle *single); GList * (* get_font_list) (EphyEmbedSingle *shell, const char *langGroup); + const char * (* get_backend_name) (EphyEmbedSingle *shell); }; GType ephy_embed_single_get_type (void); @@ -97,6 +98,8 @@ gboolean ephy_embed_single_get_network_status (EphyEmbedSingle *single); GList *ephy_embed_single_get_font_list (EphyEmbedSingle *single, const char *lang_group); +const char *ephy_embed_single_get_backend_name (EphyEmbedSingle *single); + G_END_DECLS #endif diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 4165ff11e..0523473a6 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -907,6 +907,22 @@ impl_get_network_status (EphyEmbedSingle *esingle) return !isOffline; } +static const char* +impl_get_backend_name (EphyEmbedSingle *esingle) +{ + /* If you alter the return values here, remember to update + * the docs in ephy-embed-single.c */ +#if defined (HAVE_GECKO_1_10) +# error "Need to add version string for gecko 1.10" +#elif defined(HAVE_GECKO_1_9) + return "gecko-1.9"; +#elif defined(HAVE_GECKO_1_8) + return "gecko-1.8"; +#elif defined(HAVE_GECKO_1_7) + return "gecko-1.7"; +#endif +} + static GList * impl_get_font_list (EphyEmbedSingle *shell, const char *langGroup) @@ -1425,6 +1441,7 @@ ephy_embed_single_iface_init (EphyEmbedSingleIface *iface) iface->get_network_status = impl_get_network_status; iface->get_font_list = impl_get_font_list; iface->open_window = impl_open_window; + iface->get_backend_name = impl_get_backend_name; } static void diff --git a/src/epiphany.defs b/src/epiphany.defs index 34ce537de..f70c2addb 100644 --- a/src/epiphany.defs +++ b/src/epiphany.defs @@ -881,7 +881,11 @@ ) ) - +(define-method get_backend_name + (of-object "EphyEmbedSingle") + (c-name "ephy_embed_single_get_backend_name") + (return-type "const-char*") +) ;; From ../embed/ephy-embed-type-builtins.h -- cgit v1.2.3