diff options
Diffstat (limited to 'embed')
-rw-r--r-- | embed/Makefile.am | 35 | ||||
-rw-r--r-- | embed/ephy-embed-favicon.c | 4 | ||||
-rw-r--r-- | embed/ephy-embed-popup.c | 7 | ||||
-rw-r--r-- | embed/ephy-embed-shell.c | 51 | ||||
-rw-r--r-- | embed/ephy-embed-shell.h | 39 | ||||
-rw-r--r-- | embed/ephy-embed-utils.c | 1 | ||||
-rw-r--r-- | embed/ephy-embed.c | 35 | ||||
-rw-r--r-- | embed/ephy-embed.h | 37 | ||||
-rw-r--r-- | embed/mozilla/EphyWrapper.cpp | 574 | ||||
-rw-r--r-- | embed/mozilla/EphyWrapper.h | 18 | ||||
-rw-r--r-- | embed/mozilla/Makefile.am | 38 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-shell.cpp | 112 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 93 |
13 files changed, 51 insertions, 993 deletions
diff --git a/embed/Makefile.am b/embed/Makefile.am index a6f43fb46..2cf70c57c 100644 --- a/embed/Makefile.am +++ b/embed/Makefile.am @@ -17,15 +17,16 @@ INCLUDES = \ noinst_LTLIBRARIES = libephyembed.la libephyembed_la_SOURCES = \ - ephy-embed-types.h \ downloader-view.c \ downloader-view.h \ - ephy-history.c \ - ephy-history.h \ ephy-embed.c \ ephy-embed.h \ - ephy-embed-shell.c \ - ephy-embed-shell.h \ + ephy-embed-dialog.c \ + ephy-embed-dialog.h \ + ephy-embed-event.c \ + ephy-embed-event.h \ + ephy-embed-favicon.c \ + ephy-embed-favicon.h \ ephy-embed-persist.c \ ephy-embed-persist.h \ ephy-embed-popup.c \ @@ -34,24 +35,22 @@ libephyembed_la_SOURCES = \ ephy-embed-popup-bw.h \ ephy-embed-popup-control.c \ ephy-embed-popup-control.h \ - ephy-embed-event.c \ - ephy-embed-event.h \ + ephy-embed-prefs.h \ + ephy-embed-shell.c \ + ephy-embed-shell.h \ + ephy-embed-types.h \ ephy-embed-utils.c \ ephy-embed-utils.h \ - ephy-embed-dialog.c \ - ephy-embed-dialog.h \ + ephy-favicon.c \ + ephy-favicon.h \ + ephy-favicon-cache.c \ + ephy-favicon-cache.h \ + ephy-history.c \ + ephy-history.h \ find-dialog.c \ find-dialog.h \ print-dialog.c \ - print-dialog.h \ - ephy-embed-prefs.h \ - ephy-favicon-cache.c \ - ephy-favicon-cache.h \ - ephy-embed-favicon.c \ - ephy-embed-favicon.h \ - ephy-favicon.c \ - ephy-favicon.h - + print-dialog.h libephyembed_la_LIBADD = \ $(top_builddir)/embed/mozilla/libephymozillaembed.la diff --git a/embed/ephy-embed-favicon.c b/embed/ephy-embed-favicon.c index d88eb91cf..f1020441c 100644 --- a/embed/ephy-embed-favicon.c +++ b/embed/ephy-embed-favicon.c @@ -124,7 +124,7 @@ location_changed_cb (EphyEmbed *embed, { char *location; - ephy_embed_get_location (embed, TRUE, FALSE, &location); + ephy_embed_get_location (embed, TRUE, &location); ephy_favicon_set_url (EPHY_FAVICON (favicon), location); g_free (location); @@ -141,7 +141,7 @@ favicon_cb (EphyEmbed *embed, if (favicon->priv->embed == NULL) return; - ephy_embed_get_location (favicon->priv->embed, TRUE, TRUE, &url); + ephy_embed_get_location (favicon->priv->embed, TRUE, &url); g_object_get (G_OBJECT (favicon), "cache", &cache, diff --git a/embed/ephy-embed-popup.c b/embed/ephy-embed-popup.c index 4710fa211..5f6eddf41 100644 --- a/embed/ephy-embed-popup.c +++ b/embed/ephy-embed-popup.c @@ -337,8 +337,7 @@ embed_popup_copy_location_cmd (BonoboUIComponent *uic, const char* verbname) { char *location; - ephy_embed_get_location (popup->priv->embed, FALSE, - FALSE, &location); + ephy_embed_get_location (popup->priv->embed, FALSE, &location); embed_popup_copy_to_clipboard (popup, location); g_free (location); } @@ -563,7 +562,7 @@ embed_popup_save_page_as_cmd (BonoboUIComponent *uic, char *location; ephy_embed_get_location (popup->priv->embed, - FALSE, FALSE, &location); + FALSE, &location); save_url (popup, TRUE, FALSE, location); g_free (location); } @@ -584,7 +583,7 @@ embed_popup_open_frame_cmd (BonoboUIComponent *uic, char *location; ephy_embed_get_location (popup->priv->embed, - FALSE, FALSE, &location); + FALSE, &location); ephy_embed_load_url (popup->priv->embed, location); } diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 541e48007..9bb72942a 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -318,34 +318,6 @@ ephy_embed_shell_get_font_list (EphyEmbedShell *shell, } gresult -ephy_embed_shell_set_permission (EphyEmbedShell *shell, - const char *url, - PermissionType type, - gboolean allow) -{ - EphyEmbedShellClass *klass = EPHY_EMBED_SHELL_GET_CLASS (shell); - return klass->set_permission (shell, url, type, allow); -} - -gresult -ephy_embed_shell_list_permissions (EphyEmbedShell *shell, - PermissionType type, - GList **permissions) -{ - EphyEmbedShellClass *klass = EPHY_EMBED_SHELL_GET_CLASS (shell); - return klass->list_permissions (shell, type, permissions); -} - -gresult -ephy_embed_shell_remove_permissions (EphyEmbedShell *shell, - PermissionType type, - GList *permissions) -{ - EphyEmbedShellClass *klass = EPHY_EMBED_SHELL_GET_CLASS (shell); - return klass->remove_permissions (shell, type, permissions); -} - -gresult ephy_embed_shell_list_cookies (EphyEmbedShell *shell, GList **cookies) { @@ -442,26 +414,6 @@ impl_get_downloader_view (EphyEmbedShell *shell) } gresult -ephy_embed_shell_free_permissions (EphyEmbedShell *shell, - GList *permissions) -{ - GList *l; - - for (l = permissions; l != NULL; l = l->next) - { - PermissionInfo *info = (PermissionInfo *)l->data; - - g_free (info->type); - g_free (info->domain); - g_free (info); - } - - g_list_free (permissions); - - return G_OK; -} - -gresult ephy_embed_shell_free_cookies (EphyEmbedShell *shell, GList *cookies) { @@ -471,8 +423,7 @@ ephy_embed_shell_free_cookies (EphyEmbedShell *shell, { CookieInfo *info = (CookieInfo *)l->data; - g_free (info->base.type); - g_free (info->base.domain); + g_free (info->domain); g_free (info->name); g_free (info->value); g_free (info->path); diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h index 3c3b11603..75d630f23 100644 --- a/embed/ephy-embed-shell.h +++ b/embed/ephy-embed-shell.h @@ -63,20 +63,11 @@ typedef struct } FileFormat; /** - * BlockedHost: a blocked host - */ -typedef struct -{ - gchar *type; - gchar *domain; -} PermissionInfo; - -/** * Cookie: the type of cookies */ typedef struct { - PermissionInfo base; + gchar *domain; gchar *name; gchar *value; gchar *path; @@ -128,7 +119,6 @@ typedef enum JAVA_CONSOLE_CAP = 1 << 3, JS_CONSOLE_CAP = 1 << 4, CHARSETS_CAP = 1 << 5, - PERMISSIONS_CAP = 1 << 6, COOKIES_CAP = 1 << 7, PASSWORDS_CAP = 1 << 8, FILEPICKER_CAP = 1 << 9 @@ -172,16 +162,6 @@ struct EphyEmbedShellClass const char *fontType, GList **fontList, char **default_font); - gresult (* set_permission) (EphyEmbedShell *shell, - const char *url, - PermissionType type, - gboolean allow); - gresult (* list_permissions) (EphyEmbedShell *shell, - PermissionType type, - GList **permissions); - gresult (* remove_permissions) (EphyEmbedShell *shell, - PermissionType type, - GList *permissions); gresult (* list_cookies) (EphyEmbedShell *shell, GList **cokies); gresult (* remove_cookies) (EphyEmbedShell *shell, @@ -252,23 +232,6 @@ gresult ephy_embed_shell_get_font_list (EphyEmbedShell *shell, GList **fontList, char **default_font); -/* Permissions */ -gresult ephy_embed_shell_set_permission (EphyEmbedShell *shell, - const char *url, - PermissionType type, - gboolean allow); - -gresult ephy_embed_shell_list_permissions (EphyEmbedShell *shell, - PermissionType type, - GList **permissions); - -gresult ephy_embed_shell_free_permissions (EphyEmbedShell *shell, - GList *permissions); - -gresult ephy_embed_shell_remove_permissions (EphyEmbedShell *shell, - PermissionType type, - GList *permissions); - /* Cookies */ gresult ephy_embed_shell_list_cookies (EphyEmbedShell *shell, GList **cookies); diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c index 0d94e5374..f76a2b7e5 100644 --- a/embed/ephy-embed-utils.c +++ b/embed/ephy-embed-utils.c @@ -76,7 +76,6 @@ ephy_embed_utils_save (GtkWidget *window, ephy_embed_get_location (embed, flags & EMBED_PERSIST_MAINDOC, - FALSE, &target); } diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index cb513f95c..b12a9c732 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -385,11 +385,10 @@ ephy_embed_get_title (EphyEmbed *embed, gresult ephy_embed_get_location (EphyEmbed *embed, gboolean toplevel, - gboolean requested, char **location) { EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); - return klass->get_location (embed, toplevel, requested, location); + return klass->get_location (embed, toplevel, location); } gresult @@ -410,22 +409,6 @@ ephy_embed_copy_page (EphyEmbed *dest, } gresult -ephy_embed_grab_focus (EphyEmbed *embed) -{ - EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); - return klass->grab_focus (embed); -} - -gresult -ephy_embed_get_link_tags (EphyEmbed *embed, - const char *link_type, - GList **tags) -{ - EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); - return klass->get_link_tags (embed, link_type, tags); -} - -gresult ephy_embed_zoom_set (EphyEmbed *embed, int zoom, gboolean reflow) @@ -535,22 +518,6 @@ ephy_embed_shistory_copy (EphyEmbed *source, } gresult -ephy_embed_scroll (EphyEmbed *embed, - EmbedScrollDirection direction) -{ - EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); - return klass->scroll (embed, direction); -} - -gresult -ephy_embed_fine_scroll (EphyEmbed *embed, - int horiz, int vert) -{ - EphyEmbedClass *klass = EPHY_EMBED_GET_CLASS (embed); - return klass->fine_scroll (embed, horiz, vert); -} - -gresult ephy_embed_get_security_level (EphyEmbed *embed, EmbedSecurityLevel *level, char **description) diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h index 1de35d7aa..d35a03ebf 100644 --- a/embed/ephy-embed.h +++ b/embed/ephy-embed.h @@ -65,8 +65,7 @@ typedef enum EMBED_SCROLL_CAP = 1 << 8, EMBED_SECURITY_CAP = 1 << 9, EMBED_CHARSET_CAP = 1 << 10, - EMBED_SHISTORY_CAP = 1 << 11, - EMBED_FINE_SCROLL_CAP = 1 << 12 + EMBED_SHISTORY_CAP = 1 << 11 } EmbedCapabilities; typedef struct @@ -153,14 +152,6 @@ typedef enum typedef enum { - EMBED_SCROLL_UP, - EMBED_SCROLL_DOWN, - EMBED_SCROLL_LEFT, - EMBED_SCROLL_RIGHT -} EmbedScrollDirection; - -typedef enum -{ STATE_IS_UNKNOWN, STATE_IS_INSECURE, STATE_IS_BROKEN, @@ -237,17 +228,12 @@ struct EphyEmbedClass char **title); gresult (* get_location) (EphyEmbed *embed, gboolean toplevel, - gboolean requested, char **location); gresult (* reload) (EphyEmbed *embed, EmbedReloadFlags flags); gresult (* copy_page) (EphyEmbed *dest, EphyEmbed *source, EmbedDisplayType display_type); - gresult (* grab_focus) (EphyEmbed *embed); - gresult (* get_link_tags) (EphyEmbed *embed, - const char *link_type, - GList **tags); gresult (* zoom_set) (EphyEmbed *embed, int zoom, gboolean reflow); @@ -273,10 +259,6 @@ struct EphyEmbedClass int nth); gboolean (* shistory_copy) (EphyEmbed *source, EphyEmbed *dest); - gresult (* scroll) (EphyEmbed *embed, - EmbedScrollDirection direction); - gresult (* fine_scroll) (EphyEmbed *embed, - int horiz, int vert); gresult (* get_security_level) (EphyEmbed *embed, EmbedSecurityLevel *level, char **description); @@ -344,7 +326,6 @@ gresult ephy_embed_get_title (EphyEmbed *embed, gresult ephy_embed_get_location (EphyEmbed *embed, gboolean toplevel, - gboolean requested, char **location); gresult ephy_embed_reload (EphyEmbed *embed, @@ -354,16 +335,6 @@ gresult ephy_embed_copy_page (EphyEmbed *dest, EphyEmbed *source, EmbedDisplayType display_type); -gresult ephy_embed_grab_focus (EphyEmbed *embed); - -/* Link */ -gresult ephy_embed_get_favicon_location (EphyEmbed *embed, - char **url); - -gresult ephy_embed_get_link_tags (EphyEmbed *embed, - const char *link_type, - GList **tags); - /* Zoom */ gresult ephy_embed_zoom_set (EphyEmbed *embed, int zoom, @@ -408,12 +379,6 @@ gboolean ephy_embed_shistory_copy (EphyEmbed *source, /* Utils */ -gresult ephy_embed_scroll (EphyEmbed *embed, - EmbedScrollDirection direction); - -gresult ephy_embed_fine_scroll (EphyEmbed *embed, - int horiz, int vert); - gresult ephy_embed_get_security_level (EphyEmbed *embed, EmbedSecurityLevel *level, char **description); diff --git a/embed/mozilla/EphyWrapper.cpp b/embed/mozilla/EphyWrapper.cpp index ade9e67b2..716b5e75c 100644 --- a/embed/mozilla/EphyWrapper.cpp +++ b/embed/mozilla/EphyWrapper.cpp @@ -671,26 +671,6 @@ nsresult EphyWrapper::GetDocumentUrl (nsCString &url) return NS_OK; } -nsresult EphyWrapper::GetDocumentTitle (char **title) -{ - nsresult result; - - nsCOMPtr<nsIDOMDocument> DOMDocument; - - result = GetDOMDocument (getter_AddRefs(DOMDocument)); - if (NS_FAILED(result) || !DOMDocument) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDocument> doc = do_QueryInterface(DOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - const nsString* t; - t = doc->GetDocumentTitle(); - - *title = g_strdup (NS_ConvertUCS2toUTF8(*t).get()); - - return NS_OK; -} - nsresult EphyWrapper::CopyHistoryTo (EphyWrapper *dest) { nsresult result; @@ -809,566 +789,12 @@ nsresult EphyWrapper::Paste(void) return clipboard->Paste (); } -nsresult EphyWrapper::GetLinkInterfaceItems (GList **list) -{ -#ifdef NOT_PORTED - nsresult result; - PRUint32 links_count; - - /* we accept these rel=.. elements, specified by the w3c */ - const gchar *rel_types[] = { - "START", "NEXT", "PREV", "PREVIOUS", "CONTENTS", "TOC", "INDEX", - "GLOSSARY", "COPYRIGHT", "CHAPTER", "SECTION", - "SUBSECTION", "APPENDIX", "HELP", "TOP", "SEARCH", "MADE", - "BOOKMARK", "HOME", - NULL /* terminator, must be last */ - }; - - nsCOMPtr<nsIDOMDocument> DOMDocument; - result = GetMainDOMDocument (getter_AddRefs(DOMDocument)); - if (NS_FAILED(result) || !DOMDocument) return NS_ERROR_FAILURE; - - /* get list of link elements*/ - NS_NAMED_LITERAL_STRING(strname, "LINK"); - - nsCOMPtr<nsIDOMNodeList> links; - result = aDOMDocument->GetElementsByTagName (strname, - getter_AddRefs (links)); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; - - result = links->GetLength (&links_count); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; - - for (PRUint32 i = 0; i < links_count; i++) - { - /* get to the link element */ - nsCOMPtr<nsIDOMNode> link; - result = links->Item (i, getter_AddRefs (link)); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMElement> linkElement; - linkElement = do_QueryInterface (aLink); - if (!linkElement) return NS_ERROR_FAILURE; - - /* get rel=.. element */ - NS_NAMED_LITERAL_STRING(attr_rel, "rel"); - nsAutoString value; - linkElement->GetAttribute (attr_rel, value); - - if (value.IsEmpty()) - { - NS_NAMED_LITERAL_STRING(attr_rev, "rev"); - linkElement->GetAttribute (attr_rev, value); - if (value.IsEmpty()) continue; - } - - nsCString relstr = NS_ConvertUCS2toUTF8(value); - ToUpperCase(relstr); - - /* check for elements we want */ - for (gint j = 0; (rel_types[j] != NULL); j++) - { - if (strcmp (relstr.get(), rel_types[j]) == 0) - { - /* found one! */ - LinkInterfaceItem *lti = - g_new0 (LinkInterfaceItem, 1); - - /* fill in struct */ - lti->type = (LinkInterfaceItemType) j; - - /* get href=.. element */ - NS_NAMED_LITERAL_STRING(attr_href, "href"); - nsAutoString value; - linkElement->GetAttribute (attr_href, value); - - if (value.IsEmpty()) - { - g_free (lti); - continue; - } - - /* resolve uri */ - nsCOMPtr<nsIDocument> doc = - do_QueryInterface (aDOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIURI> uri; - doc->GetDocumentURL(getter_AddRefs(uri)); - - const nsACString &link = NS_ConvertUCS2toUTF8(value); - nsCAutoString href; - result = uri->Resolve (link, href); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; - lti->href = g_strdup (href.get()); - - /* append to list of items */ - *list = g_list_append (*list, lti); - - /* get optional title=... element */ - NS_NAMED_LITERAL_STRING(attr_title, "title"); - linkElement->GetAttribute (attr_title, value); - if (value.IsEmpty()) continue; - - const nsACString &title = NS_ConvertUCS2toUTF8 (value); - lti->title = gul_string_strip_newline (PromiseFlatCString(title).get()); - } - } - } -#endif - return NS_OK; -} - -nsresult EphyWrapper::GetRealURL (nsCString &ret) -{ - nsresult result; - - nsCOMPtr<nsIDocShell> DocShell; - result = GetDocShell (getter_AddRefs(DocShell)); - if (NS_FAILED(result) || !DocShell) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIWebNavigation> ContentNav = do_QueryInterface (DocShell, - &result); - if (!ContentNav) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIURI> uri; - result = ContentNav->GetCurrentURI (getter_AddRefs(uri)); - if (!NS_SUCCEEDED(result) || (!uri)) return NS_ERROR_FAILURE; - - result = uri->GetSpec(ret); - if (!NS_SUCCEEDED(result) || ret.IsEmpty()) return NS_ERROR_FAILURE; - - return NS_OK; -} - nsresult EphyWrapper::SelectAll (void) { nsCOMPtr<nsIClipboardCommands> clipboard (do_GetInterface(mWebBrowser)); return clipboard->SelectAll (); } -nsresult EphyWrapper::ScrollUp (void) -{ - nsresult result; - - nsCOMPtr<nsIDOMWindow> DOMWindow; - result = GetFocusedDOMWindow (getter_AddRefs(DOMWindow)); - if (NS_FAILED(result) || !DOMWindow) return NS_ERROR_FAILURE; - - DOMWindow->ScrollByLines(-1); - - return NS_OK; -} - -nsresult EphyWrapper::ScrollDown (void) -{ - nsresult result; - - nsCOMPtr<nsIDOMWindow> DOMWindow; - result = GetFocusedDOMWindow (getter_AddRefs(DOMWindow)); - if (NS_FAILED(result) || !DOMWindow) return NS_ERROR_FAILURE; - - DOMWindow->ScrollByLines(1); - - return NS_OK; -} - -nsresult EphyWrapper::ScrollLeft (void) -{ - nsresult result; - - nsCOMPtr<nsIDOMWindow> DOMWindow; - result = GetFocusedDOMWindow (getter_AddRefs(DOMWindow)); - if (NS_FAILED(result) || !DOMWindow) return NS_ERROR_FAILURE; - - DOMWindow->ScrollBy(-16, 0); - - return NS_OK; -} - -nsresult EphyWrapper::ScrollRight (void) -{ - nsresult result; - - nsCOMPtr<nsIDOMWindow> DOMWindow; - result = GetFocusedDOMWindow (getter_AddRefs(DOMWindow)); - if (NS_FAILED(result) || !DOMWindow) return NS_ERROR_FAILURE; - - DOMWindow->ScrollBy(16, 0); - - return NS_OK; -} - -nsresult EphyWrapper::FineScroll (int horiz, int vert) -{ - nsresult result; - - nsCOMPtr<nsIDOMWindow> DOMWindow; - result = GetFocusedDOMWindow (getter_AddRefs(DOMWindow)); - if (NS_FAILED(result) || !DOMWindow) return NS_ERROR_FAILURE; - - DOMWindow->ScrollBy(horiz, vert); - - return NS_OK; -} - -nsresult EphyWrapper::GetLastModified (gchar **ret) -{ - nsresult result; - - nsCOMPtr<nsIDOMDocument> DOMDocument; - - result = GetDOMDocument (getter_AddRefs(DOMDocument)); - if (NS_FAILED(result) || !DOMDocument) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMNSHTMLDocument> doc = do_QueryInterface(DOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - nsAutoString value; - doc->GetLastModified(value); - - *ret = g_strdup (NS_ConvertUCS2toUTF8(value).get()); - - return NS_OK; -} - -nsresult EphyWrapper::GetImages (GList **ret) -{ -#ifdef NOT_PORTED - nsresult result; - GHashTable *hash = g_hash_table_new (g_str_hash, g_str_equal); - - nsCOMPtr<nsIDOMDocument> DOMDocument; - - result = GetDOMDocument (getter_AddRefs(DOMDocument)); - if (NS_FAILED(result) || !DOMDocument) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMHTMLDocument> doc = do_QueryInterface(DOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMHTMLCollection> col; - doc->GetImages(getter_AddRefs(col)); - - PRUint32 count, i; - col->GetLength(&count); - for (i = 0; i < count; i++) - { - nsCOMPtr<nsIDOMNode> node; - col->Item(i, getter_AddRefs(node)); - if (!node) continue; - - nsCOMPtr<nsIDOMHTMLElement> element; - element = do_QueryInterface(node); - if (!element) continue; - - nsCOMPtr<nsIDOMHTMLImageElement> img; - img = do_QueryInterface(element); - if (!img) continue; - - ImageListItem *item = g_new0 (ImageListItem, 1); - - nsAutoString tmp; - result = img->GetSrc (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - if (g_hash_table_lookup (hash, PromiseFlatCString(c).get())) - { - g_free (item); - continue; - } - item->url = g_strdup (c.get()); - g_hash_table_insert (hash, item->url, - GINT_TO_POINTER (TRUE)); - } - result = img->GetAlt (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - item->alt = gul_string_strip_newline (PromiseFlatCString(c).get()); - } - result = element->GetTitle (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - item->title = gul_string_strip_newline (PromiseFlatCString(c).get()); - } - result = img->GetWidth (&(item->width)); - result = img->GetHeight (&(item->height)); - - *ret = g_list_append (*ret, item); - } - - g_hash_table_destroy (hash); -#endif - return NS_OK; -} - -nsresult EphyWrapper::GetForms (GList **ret) -{ -#ifdef NOT_PORTED - nsresult result; - - nsCOMPtr<nsIDOMDocument> DOMDocument; - - result = GetDOMDocument (getter_AddRefs(DOMDocument)); - if (NS_FAILED(result) || !DOMDocument) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMHTMLDocument> doc = do_QueryInterface(DOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMHTMLCollection> col; - doc->GetForms(getter_AddRefs(col)); - - PRUint32 count, i; - col->GetLength(&count); - for (i = 0; i < count; i++) - { - nsCOMPtr<nsIDOMNode> node; - col->Item(i, getter_AddRefs(node)); - if (!node) continue; - - nsCOMPtr<nsIDOMHTMLElement> element; - element = do_QueryInterface(node); - if (!element) continue; - - nsCOMPtr<nsIDOMHTMLFormElement> form; - form = do_QueryInterface(element); - if (!form) continue; - - FormListItem *item = g_new0 (FormListItem, 1); - - nsAutoString tmp; - result = form->GetAction (tmp); - if (NS_SUCCEEDED(result)) - { - nsCOMPtr<nsIDocument> doc = - do_QueryInterface (aDOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIURI> uri; - doc->GetDocumentURL(getter_AddRefs(uri)); - - const nsACString &s = NS_ConvertUTF8toUCS2(tmp); - nsCAutoString c; - result = uri->Resolve (c, s); - - item->action = s.Length() ? g_strdup (s.get()) : g_strdup (c.get()); - } - result = form->GetMethod (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUTF8toUCS2(tmp); - item->method = g_strdup (PromiseFlatCString(c).get()); - } - result = form->GetName (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUTF8toUCS2(tmp); - item->name = g_strdup (PromiseFlatCString(c).get()); - } - - *ret = g_list_append (*ret, item); - } -#endif - return NS_OK; -} - -nsresult EphyWrapper::GetLinks (GList **ret) -{ -#ifdef NOT_PORTED - nsresult result; - - nsCOMPtr<nsIDOMDocument> DOMDocument; - result = GetMainDOMDocument (getter_AddRefs(DOMDocument)); - if (NS_FAILED(result) || !DOMDocument) return NS_ERROR_FAILURE; - - /* first, get a list of <link> elements */ - PRUint32 links_count; - - NS_NAMED_LITERAL_STRING(strname, "LINK"); - - nsCOMPtr<nsIDOMNodeList> links; - result = DOMDocument->GetElementsByTagName (strname, - getter_AddRefs (links)); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; - - result = aLinks->GetLength (&links_count); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; - - for (PRUint32 i = 0; i < links_count; i++) - { - nsCOMPtr<nsIDOMNode> link; - result = links->Item (i, getter_AddRefs (link)); - if (NS_FAILED (result)) continue; - - nsCOMPtr<nsIDOMElement> linkElement; - linkElement = do_QueryInterface (link); - if (!linkElement) continue; - - NS_NAMED_LITERAL_STRING(attr_href, "href"); - nsAutoString value; - linkElement->GetAttribute (attr_href, value); - if (value.IsEmpty()) continue; - - const nsACString &link = NS_ConvertUCS2toUTF8(value); - - if (link.IsEmpty()) continue; - - nsCOMPtr<nsIDocument> doc = - do_QueryInterface (aDOMDocument); - if(!doc) continue; - - nsCOMPtr<nsIURI> uri; - doc->GetDocumentURL(getter_AddRefs(uri)); - - nsCAutoString tmp; - result = uri->Resolve (link, tmp); - - LinkListItem *i = g_new0 (LinkListItem, 1); - - if (!tmp.IsEmpty()) - { - i->url = g_strdup (tmp.get()); - } - else - { - i->url = g_strdup (link.get()); - } - - NS_NAMED_LITERAL_STRING(attr_title, "title"); - linkElement->GetAttribute (attr_title, value); - if (!value.IsEmpty()) - { - const nsACString &s = NS_ConvertUCS2toUTF8(value); - i->title = gul_string_strip_newline (PromiseFlatCString(s).get()); - } - - NS_NAMED_LITERAL_STRING(attr_rel, "rel"); - linkElement->GetAttribute (attr_rel, value); - if (!value.IsEmpty()) - { - const nsACString &s = NS_ConvertUCS2toUTF8(value); - i->rel = g_strdup (PromiseFlatCString(s).get()); - g_strdown (i->rel); - } - if (!i->rel || strlen (i->rel) == 0) - { - NS_NAMED_LITERAL_STRING(attr_rev, "rev"); - linkElement->GetAttribute (attr_rev, value); - if (!value.IsEmpty()) - { - const nsACString &s = NS_ConvertUCS2toUTF8(value); - i->rel = g_strdup (PromiseFlatCString(s).get()); - g_strdown (i->rel); - } - } - - *ret = g_list_append (*ret, i); - } - - /* next, get a list of anchors */ - nsCOMPtr<nsIDOMHTMLDocument> doc = do_QueryInterface(aDOMDocument); - if(!doc) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIDOMHTMLCollection> col; - doc->GetLinks(getter_AddRefs(col)); - - PRUint32 count, i; - col->GetLength(&count); - for (i = 0; i < count; i++) - { - nsCOMPtr<nsIDOMNode> node; - col->Item(i, getter_AddRefs(node)); - if (!node) continue; - - nsCOMPtr<nsIDOMHTMLElement> element; - element = do_QueryInterface(node); - if (!element) continue; - - nsCOMPtr<nsIDOMHTMLAnchorElement> lnk; - lnk = do_QueryInterface(element); - if (!lnk) continue; - - LinkListItem *i = g_new0 (LinkListItem, 1); - - nsAutoString tmp; - - result = lnk->GetHref (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - i->url = g_strdup (PromiseFlatCString(c).get()); - } - - result = lnk->GetRel (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - i->rel = g_strdup (PromiseFlatCString(c).get()); - g_strdown (i->rel); - } - - if (!i->rel || strlen (i->rel) == 0) - { - result = lnk->GetRev (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - i->rel = g_strdup (PromiseFlatCString(c).get()); - g_strdown (i->rel); - } - } - - i->title = mozilla_get_link_text (node); - if (i->title == NULL) - { - result = element->GetTitle (tmp); - if (NS_SUCCEEDED(result)) - { - const nsACString &c = NS_ConvertUCS2toUTF8(tmp); - i->title = gul_string_strip_newline (PromiseFlatCString(c).get()); - } - } - - - *ret = g_list_append (*ret, i); - } -#endif - return NS_OK; -} - -nsresult EphyWrapper::EvaluateJS (char *script) -{ - nsresult rv; - - nsCOMPtr<nsIDOMWindow> DOMWindow; - rv = mWebBrowser->GetContentDOMWindow(getter_AddRefs(DOMWindow)); - - nsCOMPtr<nsIScriptGlobalObject> globalObject; - globalObject = do_QueryInterface (DOMWindow); - if (!globalObject) return NS_ERROR_FAILURE; - - nsCOMPtr<nsIScriptContext> context; - rv = globalObject->GetContext(getter_AddRefs(context)); - if (NS_FAILED(rv) || !context) { - return NS_ERROR_FAILURE; - } - - context->SetProcessingScriptTag(PR_TRUE); - - PRBool isUndefined; - nsAutoString ret; - const nsAString &aScript = NS_ConvertUTF8toUCS2(script); - context->EvaluateString(aScript, nsnull, nsnull, nsnull, - 0, nsnull, - ret, &isUndefined); - - context->SetProcessingScriptTag(PR_FALSE); - - return NS_OK; -} - nsresult EphyWrapper::PushTargetDocument (nsIDOMDocument *domDoc) { mTargetDocument = domDoc; diff --git a/embed/mozilla/EphyWrapper.h b/embed/mozilla/EphyWrapper.h index 04379546c..0345ede30 100644 --- a/embed/mozilla/EphyWrapper.h +++ b/embed/mozilla/EphyWrapper.h @@ -62,7 +62,6 @@ public: nsresult GetMainDocumentUrl (nsCString &url); nsresult GetDocumentUrl (nsCString &url); - nsresult GetDocumentTitle (char **title); nsresult ReloadDocument (); nsresult LoadDocument(nsISupports *aPageDescriptor, PRUint32 aDisplayType); @@ -95,25 +94,8 @@ public: nsresult GetMainDOMDocument (nsIDOMDocument **aDOMDocument); - nsresult GetLinkInterfaceItems (GList **list); - - nsresult GetRealURL (nsCString &ret); - nsresult SelectAll (void); - nsresult ScrollUp (void); - nsresult ScrollDown (void); - nsresult ScrollLeft (void); - nsresult ScrollRight (void); - - nsresult FineScroll (int horiz, int vert); - - nsresult GetLastModified (gchar **ret); - nsresult GetImages (GList **ret); - nsresult GetForms (GList **ret); - nsresult GetLinks (GList **ret); - nsresult EvaluateJS (char *script); - nsresult PushTargetDocument (nsIDOMDocument *domDoc); nsresult PopTargetDocument (); diff --git a/embed/mozilla/Makefile.am b/embed/mozilla/Makefile.am index ef7ef9dfa..0bac73513 100644 --- a/embed/mozilla/Makefile.am +++ b/embed/mozilla/Makefile.am @@ -54,32 +54,22 @@ INCLUDES = \ noinst_LTLIBRARIES = libephymozillaembed.la libephymozillaembed_la_SOURCES = \ - mozilla-embed.cpp \ - mozilla-embed.h \ - mozilla-embed-shell.cpp \ - mozilla-embed-shell.h \ - mozilla-embed-persist.cpp \ - mozilla-embed-persist.h \ - mozilla-prefs.cpp \ - mozilla-prefs.h \ - mozilla-notifiers.cpp \ - mozilla-notifiers.h \ - mozilla-i18n.c \ - mozilla-i18n.h \ BaseProtocolHandler.cpp \ BaseProtocolHandler.h \ BaseProtocolContentHandler.cpp \ BaseProtocolContentHandler.h \ ContentHandler.cpp \ ContentHandler.h \ + EphyWrapper.cpp \ + EphyWrapper.h \ EventContext.cpp \ EventContext.h \ + ExternalProtocolService.cpp \ + ExternalProtocolService.h \ FilePicker.cpp \ FilePicker.h \ FtpProtocolHandler.cpp \ FtpProtocolHandler.h \ - EphyWrapper.cpp \ - EphyWrapper.h \ GlobalHistory.cpp \ GlobalHistory.h \ IRCProtocolHandler.cpp \ @@ -98,11 +88,21 @@ libephymozillaembed_la_SOURCES = \ PromptService.h \ ProgressListener.cpp \ ProgressListener.h \ - nsUnicharUtils.cpp \ - nsUnicharUtils.h \ - ExternalProtocolService.cpp \ - ExternalProtocolService.h \ StartHereProtocolHandler.cpp \ StartHereProtocolHandler.h \ EphyEventListener.cpp \ - EphyEventListener.h + EphyEventListener.h \ + mozilla-embed.cpp \ + mozilla-embed.h \ + mozilla-embed-persist.cpp \ + mozilla-embed-persist.h \ + mozilla-embed-shell.cpp \ + mozilla-embed-shell.h \ + mozilla-i18n.c \ + mozilla-i18n.h \ + mozilla-notifiers.cpp \ + mozilla-notifiers.h \ + mozilla-prefs.cpp \ + mozilla-prefs.h \ + nsUnicharUtils.cpp \ + nsUnicharUtils.h diff --git a/embed/mozilla/mozilla-embed-shell.cpp b/embed/mozilla/mozilla-embed-shell.cpp index 717985d45..8a66191b9 100644 --- a/embed/mozilla/mozilla-embed-shell.cpp +++ b/embed/mozilla/mozilla-embed-shell.cpp @@ -46,9 +46,7 @@ #include <nsIFontList.h> #include <nsISupportsPrimitives.h> #include <nsReadableUtils.h> -#include <nsIPermissionManager.h> #include <nsICookieManager.h> -#include <nsIPermission.h> #include <nsIPasswordManager.h> #include <nsIPassword.h> #include <nsICookie.h> @@ -92,19 +90,6 @@ impl_get_font_list (EphyEmbedShell *shell, GList **fontList, char **default_font); static gresult -impl_set_permission (EphyEmbedShell *shell, - const char *url, - PermissionType type, - gboolean allow); -static gresult -impl_list_permissions (EphyEmbedShell *shell, - PermissionType type, - GList **permissions); -static gresult -impl_remove_permissions (EphyEmbedShell *shell, - PermissionType type, - GList *permissions); -static gresult impl_list_cookies (EphyEmbedShell *shell, GList **cookies); static gresult @@ -191,9 +176,6 @@ mozilla_embed_shell_class_init (MozillaEmbedShellClass *klass) shell_class->get_charset_titles = impl_get_charset_titles; shell_class->get_charset_groups = impl_get_charset_groups; shell_class->get_font_list = impl_get_font_list; - shell_class->set_permission = impl_set_permission; - shell_class->list_permissions = impl_list_permissions; - shell_class->remove_permissions = impl_remove_permissions; shell_class->list_cookies = impl_list_cookies; shell_class->remove_cookies = impl_remove_cookies; shell_class->list_passwords = impl_list_passwords; @@ -533,7 +515,6 @@ impl_get_capabilities (EphyEmbedShell *shell, JAVA_CONSOLE_CAP | JS_CONSOLE_CAP | CHARSETS_CAP | - PERMISSIONS_CAP | COOKIES_CAP | PASSWORDS_CAP); @@ -777,95 +758,6 @@ impl_get_font_list (EphyEmbedShell *shell, } static gresult -impl_set_permission (EphyEmbedShell *shell, - const char *url, - PermissionType type, - gboolean allow) -{ - nsresult rv; - nsCOMPtr<nsIPermissionManager> permissionManager = - do_CreateInstance (NS_PERMISSIONMANAGER_CONTRACTID); - - rv = permissionManager->Add (nsDependentCString(url), - allow ? PR_TRUE : PR_FALSE, type); - if (NS_FAILED(rv)) return G_FAILED; - - return G_OK; -} - -static gresult -impl_list_permissions (EphyEmbedShell *shell, - PermissionType type, - GList **permissions) -{ - nsresult result; - - *permissions = NULL; - - nsCOMPtr<nsIPermissionManager> permissionManager = - do_CreateInstance (NS_PERMISSIONMANAGER_CONTRACTID); - nsCOMPtr<nsISimpleEnumerator> permissionEnumerator; - result = permissionManager->GetEnumerator (getter_AddRefs(permissionEnumerator)); - if (NS_FAILED(result)) return G_FAILED; - - PRBool enumResult; - for (permissionEnumerator->HasMoreElements(&enumResult) ; - enumResult == PR_TRUE ; - permissionEnumerator->HasMoreElements(&enumResult)) - { - nsCOMPtr<nsIPermission> nsPermission; - result = permissionEnumerator->GetNext (getter_AddRefs(nsPermission)); - if (NS_FAILED(result)) return G_FAILED; - - PRInt32 cType; - nsPermission->GetType (&cType); - if (cType == type) - { - PermissionInfo *b = g_new0 (PermissionInfo, 1); - gchar *tmp = NULL; - - nsPermission->GetHost (&tmp); - b->domain = g_strdup (tmp); - nsMemory::Free (tmp); - - PRBool cap; - nsPermission->GetCapability (&cap); - if (cap == PR_TRUE) - b->type = g_strdup (_("Allowed")); - else - b->type = g_strdup (_("Blocked")); - - *permissions = g_list_prepend (*permissions, b); - } - } - - *permissions = g_list_reverse (*permissions); - - return G_OK; -} - -static gresult -impl_remove_permissions (EphyEmbedShell *shell, - PermissionType type, - GList *permissions) -{ - nsresult result; - nsCOMPtr<nsIPermissionManager> permissionManager = - do_CreateInstance (NS_PERMISSIONMANAGER_CONTRACTID); - - for (GList *permissions = g_list_first(permissions); permissions != NULL; - permissions = g_list_next(permissions)) - { - PermissionInfo *b = (PermissionInfo *)permissions->data; - result = permissionManager->Remove (nsDependentCString(b->domain), - type); - if (NS_FAILED(result)) return G_FAILED; - }; - - return G_OK; -} - -static gresult impl_list_cookies (EphyEmbedShell *shell, GList **cookies) { @@ -894,7 +786,7 @@ impl_list_cookies (EphyEmbedShell *shell, nsCAutoString transfer; nsCookie->GetHost (transfer); - c->base.domain = g_strdup (transfer.get()); + c->domain = g_strdup (transfer.get()); nsCookie->GetName (transfer); c->name = g_strdup (transfer.get()); nsCookie->GetValue (transfer); @@ -938,7 +830,7 @@ impl_remove_cookies (EphyEmbedShell *shell, { CookieInfo *c = (CookieInfo *)cl->data; - result = cookieManager->Remove (NS_LITERAL_CSTRING(c->base.domain), + result = cookieManager->Remove (NS_LITERAL_CSTRING(c->domain), NS_LITERAL_CSTRING(c->name), NS_LITERAL_CSTRING(c->path), PR_FALSE); diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index d3d2277b0..66330db4a 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -93,7 +93,6 @@ impl_get_title (EphyEmbed *embed, static gresult impl_get_location (EphyEmbed *embed, gboolean toplevel, - gboolean requested, char **location); static gresult impl_reload (EphyEmbed *embed, @@ -102,12 +101,6 @@ static gresult impl_copy_page (EphyEmbed *dest, EphyEmbed *source, EmbedDisplayType display_type); -static gresult -impl_grab_focus (EphyEmbed *embed); -static gresult -impl_get_link_tags (EphyEmbed *embed, - const char *link_type, - GList **tags); static gresult impl_zoom_set (EphyEmbed *embed, int zoom, @@ -148,12 +141,6 @@ static gboolean impl_shistory_copy (EphyEmbed *source, EphyEmbed *dest); static gresult -impl_scroll (EphyEmbed *embed, - EmbedScrollDirection direction); -static gresult -impl_fine_scroll (EphyEmbed *embed, - int horiz, int vert); -static gresult impl_get_security_level (EphyEmbed *embed, EmbedSecurityLevel *level, char **description); @@ -325,8 +312,6 @@ ephy_embed_init (EphyEmbedClass *embed_class) embed_class->get_location = impl_get_location; embed_class->reload = impl_reload; embed_class->copy_page = impl_copy_page; - embed_class->grab_focus = impl_grab_focus; - embed_class->get_link_tags = impl_get_link_tags; embed_class->zoom_set = impl_zoom_set; embed_class->zoom_get = impl_zoom_get; embed_class->selection_can_cut = impl_selection_can_cut; @@ -340,8 +325,6 @@ ephy_embed_init (EphyEmbedClass *embed_class) embed_class->shistory_get_pos = impl_shistory_get_pos; embed_class->shistory_go_nth = impl_shistory_go_nth; embed_class->shistory_copy = impl_shistory_copy; - embed_class->scroll = impl_scroll; - embed_class->fine_scroll = impl_fine_scroll; embed_class->get_security_level = impl_get_security_level; embed_class->find = impl_find; embed_class->set_charset = impl_set_charset; @@ -462,8 +445,6 @@ impl_get_capabilities (EphyEmbed *embed, EMBED_ZOOM_CAP | EMBED_PRINT_CAP | EMBED_FIND_CAP | - EMBED_SCROLL_CAP | - EMBED_FINE_SCROLL_CAP | EMBED_SECURITY_CAP | EMBED_CHARSET_CAP | EMBED_SHISTORY_CAP ); @@ -523,7 +504,7 @@ impl_can_go_up (EphyEmbed *embed) char *s; gresult result; - if (ephy_embed_get_location (embed, TRUE, FALSE, &location) != G_OK) + if (ephy_embed_get_location (embed, TRUE, &location) != G_OK) return G_FAILED; g_return_val_if_fail (location != NULL, G_FAILED); if ((s = mozilla_embed_get_uri_parent (location)) != NULL) @@ -547,7 +528,7 @@ impl_get_go_up_list (EphyEmbed *embed, GSList **l) char *location; char *s; - if (ephy_embed_get_location (embed, TRUE, FALSE, &location) != G_OK) + if (ephy_embed_get_location (embed, TRUE, &location) != G_OK) return G_FAILED; g_return_val_if_fail (location != NULL, G_FAILED); @@ -586,7 +567,7 @@ impl_go_up (EphyEmbed *embed) char *uri; char *parent_uri; - ephy_embed_get_location (embed, TRUE, FALSE, &uri); + ephy_embed_get_location (embed, TRUE, &uri); g_return_val_if_fail (uri != NULL, G_FAILED); parent_uri = mozilla_embed_get_uri_parent (uri); @@ -708,7 +689,6 @@ impl_get_title (EphyEmbed *embed, static gresult impl_get_location (EphyEmbed *embed, gboolean toplevel, - gboolean requested, char **location) { char *l; @@ -726,25 +706,17 @@ impl_get_location (EphyEmbed *embed, return G_FAILED; } - /* FIXME !toplevel requested not implemented */ - if (toplevel) { l = gtk_moz_embed_get_location (GTK_MOZ_EMBED(embed)); } - else if (!toplevel) + else { rv = wrapper->GetDocumentUrl (url); l = (NS_SUCCEEDED (rv) && !url.IsEmpty()) ? g_strdup (url.get()) : NULL; } - else if (requested) - { - rv = wrapper->GetRealURL (url); - l = (NS_SUCCEEDED (rv) && !url.IsEmpty()) ? - g_strdup (url.get()) : NULL; - } *location = l; @@ -804,22 +776,6 @@ impl_copy_page (EphyEmbed *dest, return G_OK; } -static gresult -impl_grab_focus (EphyEmbed *embed) -{ - gtk_widget_grab_focus (GTK_BIN (embed)->child); - - return G_OK; -} - -static gresult -impl_get_link_tags (EphyEmbed *embed, - const char *link_type, - GList **tags) -{ - return G_NOT_IMPLEMENTED; -} - static gresult impl_zoom_set (EphyEmbed *embed, int zoom, @@ -1079,47 +1035,6 @@ impl_shistory_copy (EphyEmbed *source, } static gresult -impl_scroll (EphyEmbed *embed, - EmbedScrollDirection direction) -{ - EphyWrapper *wrapper; - - wrapper = MOZILLA_EMBED(embed)->priv->wrapper; - g_return_val_if_fail (wrapper != NULL, G_FAILED); - - switch (direction) - { - case EMBED_SCROLL_UP: - wrapper->ScrollUp (); - break; - case EMBED_SCROLL_DOWN: - wrapper->ScrollDown (); - break; - case EMBED_SCROLL_LEFT: - wrapper->ScrollLeft (); - break; - case EMBED_SCROLL_RIGHT: - wrapper->ScrollRight (); - break; - } - - return G_OK; -} - -static gresult -impl_fine_scroll (EphyEmbed *embed, int horiz, int vert) -{ - EphyWrapper *wrapper; - - wrapper = MOZILLA_EMBED(embed)->priv->wrapper; - g_return_val_if_fail (wrapper != NULL, G_FAILED); - - wrapper->FineScroll (horiz, vert); - - return G_OK; -} - -static gresult impl_get_security_level (EphyEmbed *embed, EmbedSecurityLevel *level, char **description) |