r10091 jmb - /branches/jmb/new-cache/desktop/textinput.c
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 17:30:18 2010
New Revision: 10091
URL: http://source.netsurf-browser.org?rev=10091&view=rev
Log:
Squash warning
Modified:
branches/jmb/new-cache/desktop/textinput.c
Modified: branches/jmb/new-cache/desktop/textinput.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/desktop/textinpu...
==============================================================================
--- branches/jmb/new-cache/desktop/textinput.c (original)
+++ branches/jmb/new-cache/desktop/textinput.c Sun Feb 28 17:30:18 2010
@@ -2091,11 +2091,14 @@
void textarea_reflow(struct browser_window *bw, struct box *textarea,
struct box *inline_container)
{
+ struct content *c = hlcache_handle_get_content(bw->current_content);
int width = textarea->width;
int height = textarea->height;
+
+ assert(c != NULL);
+
if (!layout_inline_container(inline_container, width,
- textarea, 0, 0,
- bw->current_content))
+ textarea, 0, 0, c))
warn_user("NoMemory", 0);
textarea->width = width;
textarea->height = height;
13 years, 6 months
r10090 stevef - in /branches/paulblokus/treeview/riscos: global_history.c hotlist.c menus.c treeview.c wimp_event.c wimp_event.h
by netsurf@semichrome.net
Author: stevef
Date: Sun Feb 28 16:08:29 2010
New Revision: 10090
URL: http://source.netsurf-browser.org?rev=10090&view=rev
Log:
RISC OS treeview menu code mostly completed (except toolbar interactions).
Modified:
branches/paulblokus/treeview/riscos/global_history.c
branches/paulblokus/treeview/riscos/hotlist.c
branches/paulblokus/treeview/riscos/menus.c
branches/paulblokus/treeview/riscos/treeview.c
branches/paulblokus/treeview/riscos/wimp_event.c
branches/paulblokus/treeview/riscos/wimp_event.h
Modified: branches/paulblokus/treeview/riscos/global_history.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/glo...
==============================================================================
--- branches/paulblokus/treeview/riscos/global_history.c (original)
+++ branches/paulblokus/treeview/riscos/global_history.c Sun Feb 28 16:08:29 2010
@@ -37,6 +37,7 @@
#include "riscos/gui.h"
#include "riscos/menus.h"
#include "riscos/options.h"
+#include "riscos/save.h"
#include "riscos/theme.h"
#include "riscos/treeview.h"
#include "riscos/wimp.h"
@@ -162,6 +163,9 @@
TREE_SELECTION, !selection);
ro_gui_menu_set_entry_shaded(global_history_window.menu,
TREE_CLEAR_SELECTION, !selection);
+
+ ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
+ NULL, NULL, NULL, NULL);
}
/**
@@ -178,6 +182,9 @@
wimp_selection *selection, menu_action action)
{
switch (action) {
+ case HISTORY_EXPORT:
+ ro_gui_dialog_open_persistent(window, dialog_saveas, true);
+ return true;
case TREE_EXPAND_ALL:
history_global_expand_all();
return true;
Modified: branches/paulblokus/treeview/riscos/hotlist.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/hot...
==============================================================================
--- branches/paulblokus/treeview/riscos/hotlist.c (original)
+++ branches/paulblokus/treeview/riscos/hotlist.c Sun Feb 28 16:08:29 2010
@@ -37,6 +37,7 @@
#include "riscos/hotlist.h"
#include "riscos/menus.h"
#include "riscos/options.h"
+#include "riscos/save.h"
#include "riscos/theme.h"
#include "riscos/treeview.h"
#include "riscos/wimp.h"
@@ -49,9 +50,6 @@
static void ro_gui_hotlist_menu_prepare(wimp_w window, wimp_menu *menu);
static bool ro_gui_hotlist_menu_select(wimp_w window, wimp_menu *menu,
wimp_selection *selection, menu_action action);
-static void ro_gui_hotlist_menu_warning(void);
-static void ro_gui_hotlist_menu_close(void);
-
/* The RISC OS hotlist window, toolbar and treeview data. */
@@ -99,13 +97,12 @@
/* Build the hotlist window menu. */
- static wimp_w one = (wimp_w) 1;
static const struct ns_menu hotlist_definition = {
"Hotlist", {
{ "Hotlist", NO_ACTION, 0 },
{ "Hotlist.New", NO_ACTION, 0 },
-// { "Hotlist.New.Folder", TREE_NEW_FOLDER, &dialog_folder },
-// { "Hotlist.New.Link", TREE_NEW_LINK, &dialog_entry },
+ { "Hotlist.New.Folder", TREE_NEW_FOLDER, 0 },
+ { "Hotlist.New.Link", TREE_NEW_LINK, 0 },
{ "_Hotlist.Export", HOTLIST_EXPORT, &dialog_saveas },
{ "Hotlist.Expand", TREE_EXPAND_ALL, 0 },
{ "Hotlist.Expand.All", TREE_EXPAND_ALL, 0 },
@@ -119,13 +116,7 @@
{ "_Hotlist.Toolbars.ToolButtons", TOOLBAR_BUTTONS, 0 },
{ "Hotlist.Toolbars.EditToolbar", TOOLBAR_EDIT, 0 },
{ "Selection", TREE_SELECTION, 0 },
- /* We want a window, but it changes depending upon
- * context. Therefore, ensure that the structure is
- * created so that we can dynamically modify the
- * actual item presented. We do this by creating a
- * fake wimp_w with the value 1, which indicates a
- * window handle as opposed to a submenu. */
- { "Selection.Edit", TREE_SELECTION_EDIT, &one },
+ { "Selection.Edit", TREE_SELECTION_EDIT, 0 },
{ "Selection.Launch", TREE_SELECTION_LAUNCH, 0 },
{ "Selection.Delete", TREE_SELECTION_DELETE, 0 },
{ "SelectAll", TREE_SELECT_ALL, 0 },
@@ -186,6 +177,10 @@
!selection);
ro_gui_menu_set_entry_shaded(hotlist_window.menu, TREE_CLEAR_SELECTION,
!selection);
+
+ ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
+ NULL, NULL, NULL, NULL);
+
}
/**
@@ -202,6 +197,9 @@
wimp_selection *selection, menu_action action)
{
switch (action) {
+ case HOTLIST_EXPORT:
+ ro_gui_dialog_open_persistent(window, dialog_saveas, true);
+ return true;
case TREE_NEW_FOLDER:
hotlist_add_folder();
return true;
@@ -227,6 +225,7 @@
hotlist_collapse_addresses();
return true;
case TREE_SELECTION_EDIT:
+ hotlist_edit_selected();
return true;
case TREE_SELECTION_LAUNCH:
hotlist_launch_selected();
@@ -245,22 +244,6 @@
}
return false;
-}
-
-/**
- * Handle Message_SubmenuWarning for the hotlist menu
- */
-
-void ro_gui_hotlist_menu_warning(void)
-{
-}
-
-/**
- * Handle the closure of the hotlist menu
- */
-
-void ro_gui_hotlist_menu_close(void)
-{
}
/**
Modified: branches/paulblokus/treeview/riscos/menus.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/men...
==============================================================================
--- branches/paulblokus/treeview/riscos/menus.c (original)
+++ branches/paulblokus/treeview/riscos/menus.c Sun Feb 28 16:08:29 2010
@@ -521,11 +521,13 @@
&g, &bw, &c, &t,
&is_cookies, &is_hotlist,
&is_global_history);
+
+ if (cleanup) {
+ ro_gui_wimp_event_menus_closed(current_menu_window,
+ current_menu_icon, current_menu);
+ }
+
current_menu = NULL;
-
- if (cleanup) {
- ro_gui_wimp_event_menus_closed();
- }
}
current_menu_window = NULL;
@@ -685,28 +687,42 @@
for (i = 1; warning->selection.items[i] != -1; i++)
menu_entry = &menu_entry->sub_menu->
entries[warning->selection.items[i]];
-
- if (IS_MENU(menu_entry->sub_menu)) {
- ro_gui_wimp_event_register_submenu((wimp_w)0);
- sub_menu = menu_entry->sub_menu;
- i = 0;
- do {
- action = ro_gui_menu_find_action(current_menu,
- &sub_menu->entries[i]);
+ action = ro_gui_menu_find_action(current_menu, menu_entry);
+
+ /* We only process the menu in the old way if the wimp_event module
+ * hasn't processed it for us.
+ */
+
+ if (!ro_gui_wimp_event_submenu_warning(current_menu_window,
+ current_menu_icon, current_menu, &(warning->selection),
+ action)) {
+ if (IS_MENU(menu_entry->sub_menu)) {
+ ro_gui_wimp_event_register_submenu((wimp_w)0);
+ sub_menu = menu_entry->sub_menu;
+ i = 0;
+ do {
+ action = ro_gui_menu_find_action(current_menu,
+ &sub_menu->entries[i]);
+ if (action != NO_ACTION)
+ ro_gui_menu_prepare_action(current_menu_window,
+ action, false);
+ } while (!(sub_menu->entries[i++].menu_flags &
+ wimp_MENU_LAST));
+ } else {
+ ro_gui_wimp_event_register_submenu((wimp_w)menu_entry->sub_menu);
+ action = ro_gui_menu_find_action(current_menu, menu_entry);
if (action != NO_ACTION)
ro_gui_menu_prepare_action(current_menu_window,
- action, false);
- } while (!(sub_menu->entries[i++].menu_flags & wimp_MENU_LAST));
- } else {
- ro_gui_wimp_event_register_submenu((wimp_w)menu_entry->sub_menu);
- action = ro_gui_menu_find_action(current_menu, menu_entry);
- if (action != NO_ACTION)
- ro_gui_menu_prepare_action(current_menu_window,
- action, true);
- /* remove the close icon */
+ action, true);
+ }
+ }
+
+ /* If this is a dialogue box, remove the close and back icons. */
+
+ if (!(IS_MENU(menu_entry->sub_menu)))
ro_gui_wimp_update_window_furniture((wimp_w)menu_entry->sub_menu,
wimp_WINDOW_CLOSE_ICON | wimp_WINDOW_BACK_ICON, 0);
- }
+
/* open the sub-menu */
error = xwimp_create_sub_menu(menu_entry->sub_menu,
@@ -1519,8 +1535,6 @@
if (!c)
return false;
/* Fall through */
- case HOTLIST_EXPORT:
- case HISTORY_EXPORT:
ro_gui_menu_prepare_action(owner, action, true);
ro_gui_dialog_open_persistent(owner, dialog_saveas,
windows_at_pointer);
@@ -2026,16 +2040,6 @@
ro_gui_save_prepare(GUI_SAVE_LINK_TEXT, NULL, NULL,
c->url, c->title);
break;
- case HOTLIST_EXPORT:
- if (windows)
- ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
- NULL, NULL, NULL, NULL);
- break;
- case HISTORY_EXPORT:
- if (windows)
- ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
- NULL, NULL, NULL, NULL);
- break;
/* navigation actions */
case BROWSER_NAVIGATE_BACK:
Modified: branches/paulblokus/treeview/riscos/treeview.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/tre...
==============================================================================
--- branches/paulblokus/treeview/riscos/treeview.c (original)
+++ branches/paulblokus/treeview/riscos/treeview.c Sun Feb 28 16:08:29 2010
@@ -61,7 +61,7 @@
#endif
/** \todo Ugh! */
-const char tree_directory_icon_name[] = "directory.png";
+const char tree_directory_icon_name[] = "file:///NetSurf:/Resources/Icons/directory.png";
const char tree_content_icon_name[] = "content.png";
struct ro_treeview
Modified: branches/paulblokus/treeview/riscos/wimp_event.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/wim...
==============================================================================
--- branches/paulblokus/treeview/riscos/wimp_event.c (original)
+++ branches/paulblokus/treeview/riscos/wimp_event.c Sun Feb 28 16:08:29 2010
@@ -102,7 +102,8 @@
bool (*window_menu_selection)(wimp_w w, wimp_menu *m,
wimp_selection *s, menu_action action);
void (*window_menu_close)(wimp_w w, wimp_menu *m);
- void (*window_menu_warning)(wimp_w w, wimp_menu *m, wimp_selection *s);
+ void (*window_menu_warning)(wimp_w w, wimp_menu *m,
+ wimp_selection *s, menu_action action);
const char *help_prefix;
void *user_data;
struct icon_event *first;
@@ -397,7 +398,8 @@
if ((event->type == EVENT_MENU_GRIGHT) && (event->i == i))
break;
if (!event) {
- if ((window->window_menu) && (window->window_menu_selection)) {
+ if ((window->window_menu) && (window->window_menu == menu)
+ && (window->window_menu_selection)) {
window->window_menu_selection(w, menu,
selection, action);
@@ -1251,7 +1253,7 @@
wimp_selection *s, menu_action action),
void (*callback_close)(wimp_w w, wimp_menu *m),
void (*callback_warning)(wimp_w w, wimp_menu *m,
- wimp_selection *s),
+ wimp_selection *s, menu_action action),
bool menu_auto)
{
struct event_window *window;
@@ -1374,12 +1376,88 @@
return event;
}
-/**
- * Handle menus being closed
- */
-void ro_gui_wimp_event_menus_closed(void)
-{
- ro_gui_wimp_event_register_submenu(0);
+/* Handle sumbenu warnings. This is called from ro_gui_menu_warning(), and
+ * returns to that function to have the submenu opened correctly.
+ *
+ * \param w the window to owning the menu
+ * \param i the icon owning the menu
+ * \param menu the menu that has been selected
+ * \param selection the selection information
+ * \param action the menu action info from menus.c
+ * \return true if the event was handled, false otherwise
+ */
+
+bool ro_gui_wimp_event_submenu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
+ wimp_selection *selection, menu_action action)
+{
+ struct event_window *window;
+ struct icon_event *event;
+
+ ro_gui_wimp_event_register_submenu(0);
+
+ /* Process the event for any window menus. Find the window data, then
+ * try and match to an icon event. If we can, then there isn't anything
+ * to do.
+ */
+
+ window = ro_gui_wimp_event_find_window(w);
+ if (!window)
+ return false;
+
+ for (event = window->first; event; event = event->next)
+ if ((event->type == EVENT_MENU_GRIGHT) && (event->i == i))
+ break;
+ if (event)
+ return false;
+
+ /* If the warning is for a window menu, then pass the event on to it. */
+
+ if ((window->window_menu) && (window->window_menu == menu)) {
+ if (window->window_menu_warning) {
+ window->window_menu_warning(w, menu, selection, action);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Handle menus being closed. This is called from ro_gui_menu_closed(), in
+ * every scenario when one of our own menus is open.
+ *
+ * \param w the window to owning the menu
+ * \param i the icon owning the menu
+ * \param menu the menu that has been selected
+ */
+
+void ro_gui_wimp_event_menus_closed(wimp_w w, wimp_i i, wimp_menu *menu)
+{
+ struct event_window *window;
+ struct icon_event *event;
+
+ ro_gui_wimp_event_register_submenu(0);
+
+ /* Process the event for any window menus. Find the window data, then
+ * try and match to an icon event. If we can, then there isn't anything
+ * to do.
+ */
+
+ window = ro_gui_wimp_event_find_window(w);
+ if (!window)
+ return;
+
+ for (event = window->first; event; event = event->next)
+ if ((event->type == EVENT_MENU_GRIGHT) && (event->i == i))
+ break;
+ if (event)
+ return;
+
+ /* If the close is for a window menu, then pass the event on to it. */
+
+ if ((window->window_menu) && (window->window_menu == menu) &&
+ (window->window_menu_close))
+ window->window_menu_close(w, menu);
}
/**
Modified: branches/paulblokus/treeview/riscos/wimp_event.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/wim...
==============================================================================
--- branches/paulblokus/treeview/riscos/wimp_event.h (original)
+++ branches/paulblokus/treeview/riscos/wimp_event.h Sun Feb 28 16:08:29 2010
@@ -88,10 +88,12 @@
wimp_selection *s, menu_action action),
void (*callback_close)(wimp_w w, wimp_menu *m),
void (*callback_warning)(wimp_w w, wimp_menu *m,
- wimp_selection *s),
+ wimp_selection *s, menu_action action),
bool menu_auto);
-void ro_gui_wimp_event_menus_closed(void);
+bool ro_gui_wimp_event_submenu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
+ wimp_selection *selection, menu_action action);
+void ro_gui_wimp_event_menus_closed(wimp_w w, wimp_i i, wimp_menu *menu);
void ro_gui_wimp_event_register_submenu(wimp_w w);
#endif
13 years, 6 months
r10089 jmb - in /branches/jmb/new-cache/css: css.c css.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 11:54:31 2010
New Revision: 10089
URL: http://source.netsurf-browser.org?rev=10089&view=rev
Log:
s/struct content/hlcache_handle/ in nscss_get_imports API
Modified:
branches/jmb/new-cache/css/css.c
branches/jmb/new-cache/css/css.h
Modified: branches/jmb/new-cache/css/css.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/css/css.c?rev=10...
==============================================================================
--- branches/jmb/new-cache/css/css.c (original)
+++ branches/jmb/new-cache/css/css.c Sun Feb 28 11:54:31 2010
@@ -23,6 +23,7 @@
#include "content/content_protected.h"
#include "content/fetch.h"
#include "content/fetchcache.h"
+#include "content/hlcache.h"
#include "css/css.h"
#include "css/internal.h"
#include "desktop/gui.h"
@@ -353,12 +354,15 @@
/**
* Retrieve imported stylesheets
*
- * \param c Stylesheet containing imports
+ * \param h Stylesheet containing imports
* \param n Pointer to location to receive number of imports
* \return Pointer to array of imported stylesheets
*/
-struct nscss_import *nscss_get_imports(struct content *c, uint32_t *n)
-{
+struct nscss_import *nscss_get_imports(hlcache_handle *h, uint32_t *n)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_CSS);
assert(n != NULL);
Modified: branches/jmb/new-cache/css/css.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/css/css.h?rev=10...
==============================================================================
--- branches/jmb/new-cache/css/css.h (original)
+++ branches/jmb/new-cache/css/css.h Sun Feb 28 11:54:31 2010
@@ -26,6 +26,7 @@
#include "utils/errors.h"
struct content;
+struct hlcache_handle;
struct nscss_import;
/**
@@ -43,6 +44,7 @@
* Imported stylesheet record
*/
struct nscss_import {
+//newcache: should be hlcache_handle
struct content *c; /**< Content containing sheet */
uint64_t media; /**< Media types that sheet applies to */
};
@@ -64,7 +66,7 @@
lwc_context *dict);
void nscss_destroy_css_data(struct content_css_data *c);
-struct nscss_import *nscss_get_imports(struct content *c, uint32_t *n);
+struct nscss_import *nscss_get_imports(struct hlcache_handle *h, uint32_t *n);
#endif
13 years, 6 months
r10088 jmb - in /branches/jmb/new-cache/render: box.c box.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 10:19:50 2010
New Revision: 10088
URL: http://source.netsurf-browser.org?rev=10088&view=rev
Log:
s/struct content/hlcache_handle/ in box*_at_point APIs
Modified:
branches/jmb/new-cache/render/box.c
branches/jmb/new-cache/render/box.h
Modified: branches/jmb/new-cache/render/box.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/box.c?rev...
==============================================================================
--- branches/jmb/new-cache/render/box.c (original)
+++ branches/jmb/new-cache/render/box.c Sun Feb 28 10:19:50 2010
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
#include "content/content_protected.h"
+#include "content/hlcache.h"
#include "css/css.h"
#include "css/dump.h"
#include "desktop/scroll.h"
@@ -312,7 +313,7 @@
struct box *box_at_point(struct box *box, const int x, const int y,
int *box_x, int *box_y,
- struct content **content)
+ hlcache_handle **content)
{
int bx = *box_x, by = *box_y;
struct box *child, *sibling;
@@ -324,6 +325,7 @@
if (box->object) {
if (box->object->type == CONTENT_HTML &&
box->object->data.html.layout) {
+//newcache: object field of struct box needs to be a hlcache_handle *
*content = box->object;
box = box->object->data.html.layout;
} else {
@@ -503,19 +505,23 @@
/**
* Find the box containing an object at the given coordinates, if any.
*
- * \param c content to search, must have type CONTENT_HTML
+ * \param h content to search, must have type CONTENT_HTML
* \param x coordinates in document units
* \param y coordinates in document units
*/
-struct box *box_object_at_point(struct content *c, int x, int y)
-{
- struct box *box = c->data.html.layout;
+struct box *box_object_at_point(hlcache_handle *h, int x, int y)
+{
+ struct content *c = hlcache_handle_get_content(h);
+ struct box *box;
int box_x = 0, box_y = 0;
- struct content *content = c;
+ hlcache_handle *content = h;
struct box *object_box = 0;
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
+
+ box = c->data.html.layout;
while ((box = box_at_point(box, x, y, &box_x, &box_y, &content))) {
if (box->style && css_computed_visibility(box->style) ==
@@ -533,19 +539,23 @@
/**
* Find the box containing an href at the given coordinates, if any.
*
- * \param c content to search, must have type CONTENT_HTML
+ * \param h content to search, must have type CONTENT_HTML
* \param x coordinates in document units
* \param y coordinates in document units
*/
-struct box *box_href_at_point(struct content *c, int x, int y)
-{
- struct box *box = c->data.html.layout;
+struct box *box_href_at_point(hlcache_handle *h, int x, int y)
+{
+ struct content *c = hlcache_handle_get_content(h);
+ struct box *box;
int box_x = 0, box_y = 0;
- struct content *content = c;
+ hlcache_handle *content = h;
struct box *href_box = 0;
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
+
+ box = c->data.html.layout;
while ((box = box_at_point(box, x, y, &box_x, &box_y, &content))) {
if (box->style && css_computed_visibility(box->style) ==
Modified: branches/jmb/new-cache/render/box.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/box.h?rev...
==============================================================================
--- branches/jmb/new-cache/render/box.h (original)
+++ branches/jmb/new-cache/render/box.h Sun Feb 28 10:19:50 2010
@@ -307,9 +307,9 @@
void box_bounds(struct box *box, struct rect *r);
void box_coords(struct box *box, int *x, int *y);
struct box *box_at_point(struct box *box, const int x, const int y,
- int *box_x, int *box_y, struct content **content);
-struct box *box_object_at_point(struct content *c, int x, int y);
-struct box *box_href_at_point(struct content *c, int x, int y);
+ int *box_x, int *box_y, struct hlcache_handle **content);
+struct box *box_object_at_point(struct hlcache_handle *h, int x, int y);
+struct box *box_href_at_point(struct hlcache_handle *h, int x, int y);
struct box *box_find_by_id(struct box *box, const char *id);
bool box_visible(struct box *box);
void box_dump(FILE *stream, struct box *box, unsigned int depth);
13 years, 6 months
r10087 jmb - in /branches/jmb/new-cache/render: imagemap.c imagemap.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 10:04:37 2010
New Revision: 10087
URL: http://source.netsurf-browser.org?rev=10087&view=rev
Log:
s/struct content/hlcache_handle/ in imagemap_get API
Modified:
branches/jmb/new-cache/render/imagemap.c
branches/jmb/new-cache/render/imagemap.h
Modified: branches/jmb/new-cache/render/imagemap.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/imagemap....
==============================================================================
--- branches/jmb/new-cache/render/imagemap.c (original)
+++ branches/jmb/new-cache/render/imagemap.c Sun Feb 28 10:04:37 2010
@@ -25,6 +25,7 @@
#include <string.h>
#include <strings.h>
#include "content/content_protected.h"
+#include "content/hlcache.h"
#include "render/box.h"
#include "render/imagemap.h"
#include "utils/log.h"
@@ -626,20 +627,21 @@
/**
* Retrieve url associated with imagemap entry
*
- * \param c The containing content
- * \param key The map name to search for
- * \param x The left edge of the containing box
- * \param y The top edge of the containing box
- * \param click_x The horizontal location of the click
- * \param click_y The vertical location of the click
- * \param target Pointer to location to receive target pointer (if any)
+ * \param h The containing content
+ * \param key The map name to search for
+ * \param x The left edge of the containing box
+ * \param y The top edge of the containing box
+ * \param click_x The horizontal location of the click
+ * \param click_y The vertical location of the click
+ * \param target Pointer to location to receive target pointer (if any)
* \return The url associated with this area, or NULL if not found
*/
-const char *imagemap_get(struct content *c, const char *key,
+const char *imagemap_get(hlcache_handle *h, const char *key,
unsigned long x, unsigned long y,
unsigned long click_x, unsigned long click_y,
const char **target)
{
+ struct content *c = hlcache_handle_get_content(h);
unsigned int slot = 0;
struct imagemap *map;
struct mapentry *entry;
Modified: branches/jmb/new-cache/render/imagemap.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/imagemap....
==============================================================================
--- branches/jmb/new-cache/render/imagemap.h (original)
+++ branches/jmb/new-cache/render/imagemap.h Sun Feb 28 10:04:37 2010
@@ -22,11 +22,13 @@
#include <libxml/HTMLtree.h>
struct content;
+struct hlcache_handle;
void imagemap_destroy(struct content *c);
void imagemap_dump(struct content *c);
bool imagemap_extract(xmlNode *node, struct content *c);
-const char *imagemap_get(struct content *c, const char *key,
+
+const char *imagemap_get(struct hlcache_handle *h, const char *key,
unsigned long x, unsigned long y,
unsigned long click_x, unsigned long click_y,
const char **target);
13 years, 6 months
r10086 jmb - in /branches/jmb/new-cache/render: textplain.c textplain.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 09:30:02 2010
New Revision: 10086
URL: http://source.netsurf-browser.org?rev=10086&view=rev
Log:
Make textplain APIs called from desktop/ and above take hlcache_handle * instead of struct content *
Modified:
branches/jmb/new-cache/render/textplain.c
branches/jmb/new-cache/render/textplain.h
Modified: branches/jmb/new-cache/render/textplain.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/textplain...
==============================================================================
--- branches/jmb/new-cache/render/textplain.c (original)
+++ branches/jmb/new-cache/render/textplain.c Sun Feb 28 09:30:02 2010
@@ -29,6 +29,7 @@
#include <math.h>
#include <iconv.h>
#include "content/content_protected.h"
+#include "content/hlcache.h"
#include "css/css.h"
#include "css/utils.h"
#include "desktop/gui.h"
@@ -472,22 +473,30 @@
/**
* Retrieve number of lines in content
*
- * \param c Content to retrieve line count from
+ * \param h Content to retrieve line count from
* \return Number of lines
*/
-unsigned long textplain_line_count(struct content *c)
-{
+unsigned long textplain_line_count(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
+
return c->data.textplain.physical_line_count;
}
/**
* Retrieve the size (in bytes) of text data
*
- * \param c Content to retrieve size of
+ * \param h Content to retrieve size of
* \return Size, in bytes, of data
*/
-size_t textplain_size(struct content *c)
-{
+size_t textplain_size(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
+
return c->data.textplain.utf8_data_size;
}
@@ -497,15 +506,16 @@
* which to search (-1 = above-left, +1 = below-right) if the co-ordinates are not
* contained within a line.
*
- * \param c content of type CONTENT_TEXTPLAIN
+ * \param h content of type CONTENT_TEXTPLAIN
* \param x x ordinate of point
* \param y y ordinate of point
* \param dir direction of search if not within line
* \return byte offset of character containing (or nearest to) point
*/
-size_t textplain_offset_from_coords(struct content *c, int x, int y, int dir)
-{
+size_t textplain_offset_from_coords(hlcache_handle *h, int x, int y, int dir)
+{
+ struct content *c = hlcache_handle_get_content(h);
float line_height = textplain_line_height();
struct textplain_line *line;
const char *text;
@@ -513,6 +523,7 @@
size_t length;
int idx;
+ assert(c != NULL);
assert(c->type == CONTENT_TEXTPLAIN);
y = (int)((float)(y - MARGIN) / line_height);
@@ -576,18 +587,23 @@
* Given a byte offset within the text, return the line number
* of the line containing that offset (or -1 if offset invalid)
*
- * \param c content of type CONTENT_TEXTPLAIN
+ * \param h content of type CONTENT_TEXTPLAIN
* \param offset byte offset within textual representation
* \return line number, or -1 if offset invalid (larger than size)
*/
-int textplain_find_line(struct content *c, unsigned offset)
-{
- struct textplain_line *line = c->data.textplain.physical_line;
- int nlines = c->data.textplain.physical_line_count;
+int textplain_find_line(hlcache_handle *h, unsigned offset)
+{
+ struct content *c = hlcache_handle_get_content(h);
+ struct textplain_line *line;
+ int nlines;
int lineno = 0;
+ assert(c != NULL);
assert(c->type == CONTENT_TEXTPLAIN);
+
+ line = c->data.textplain.physical_line;
+ nlines = c->data.textplain.physical_line_count;
if (offset > c->data.textplain.utf8_data_size)
return -1;
@@ -646,30 +662,33 @@
* Given a range of byte offsets within a UTF8 textplain content,
* return a box that fully encloses the text
*
- * \param c content of type CONTENT_TEXTPLAIN
+ * \param h content of type CONTENT_TEXTPLAIN
* \param start byte offset of start of text range
* \param end byte offset of end
* \param r rectangle to be completed
*/
-void textplain_coords_from_range(struct content *c, unsigned start, unsigned end,
- struct rect *r)
-{
+void textplain_coords_from_range(hlcache_handle *h, unsigned start,
+ unsigned end, struct rect *r)
+{
+ struct content *c = hlcache_handle_get_content(h);
float line_height = textplain_line_height();
- char *utf8_data = c->data.textplain.utf8_data;
+ char *utf8_data;
struct textplain_line *line;
unsigned lineno = 0;
unsigned nlines;
+ assert(c != NULL);
assert(c->type == CONTENT_TEXTPLAIN);
assert(start <= end);
assert(end <= c->data.textplain.utf8_data_size);
+ utf8_data = c->data.textplain.utf8_data;
nlines = c->data.textplain.physical_line_count;
line = c->data.textplain.physical_line;
/* find start */
- lineno = textplain_find_line(c, start);
+ lineno = textplain_find_line(h, start);
r->y0 = (int)(MARGIN + lineno * line_height);
@@ -678,7 +697,7 @@
forwards most of the time */
/* find end */
- lineno = textplain_find_line(c, end);
+ lineno = textplain_find_line(h, end);
r->x0 = 0;
r->x1 = c->data.textplain.formatted_width;
@@ -701,18 +720,20 @@
/**
* Return a pointer to the requested line of text.
*
- * \param c content of type CONTENT_TEXTPLAIN
+ * \param h content of type CONTENT_TEXTPLAIN
* \param lineno line number
* \param poffset receives byte offset of line start within text
* \param plen receives length of returned line
* \return pointer to text, or NULL if invalid line number
*/
-char *textplain_get_line(struct content *c, unsigned lineno,
+char *textplain_get_line(hlcache_handle *h, unsigned lineno,
size_t *poffset, size_t *plen)
{
+ struct content *c = hlcache_handle_get_content(h);
struct textplain_line *line;
+ assert(c != NULL);
assert(c->type == CONTENT_TEXTPLAIN);
if (lineno >= c->data.textplain.physical_line_count)
@@ -730,19 +751,23 @@
* text to fit the window width. Thus only hard newlines are preserved
* in the saved/copied text of a selection.
*
- * \param c content of type CONTENT_TEXTPLAIN
+ * \param h content of type CONTENT_TEXTPLAIN
* \param start starting byte offset within UTF-8 text
* \param end ending byte offset
* \param plen receives validated length
* \return pointer to text, or NULL if no text
*/
-char *textplain_get_raw_data(struct content *c, unsigned start, unsigned end,
+char *textplain_get_raw_data(hlcache_handle *h, unsigned start, unsigned end,
size_t *plen)
{
- size_t utf8_size = c->data.textplain.utf8_data_size;
-
+ struct content *c = hlcache_handle_get_content(h);
+ size_t utf8_size;
+
+ assert(c != NULL);
assert(c->type == CONTENT_TEXTPLAIN);
+
+ utf8_size = c->data.textplain.utf8_data_size;
/* any text at all? */
if (!utf8_size) return NULL;
Modified: branches/jmb/new-cache/render/textplain.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/textplain...
==============================================================================
--- branches/jmb/new-cache/render/textplain.h (original)
+++ branches/jmb/new-cache/render/textplain.h Sun Feb 28 09:30:02 2010
@@ -28,6 +28,7 @@
#include <iconv.h>
struct content;
+struct hlcache_handle;
struct textplain_line {
size_t start;
@@ -57,16 +58,17 @@
float scale, colour background_colour);
/* access to lines for text selection and searching */
-unsigned long textplain_line_count(struct content *c);
-size_t textplain_size(struct content *c);
+unsigned long textplain_line_count(struct hlcache_handle *h);
+size_t textplain_size(struct hlcache_handle *h);
-size_t textplain_offset_from_coords(struct content *c, int x, int y, int dir);
-void textplain_coords_from_range(struct content *c,
+size_t textplain_offset_from_coords(struct hlcache_handle *h, int x, int y,
+ int dir);
+void textplain_coords_from_range(struct hlcache_handle *h,
unsigned start, unsigned end, struct rect *r);
-char *textplain_get_line(struct content *c, unsigned lineno,
+char *textplain_get_line(struct hlcache_handle *h, unsigned lineno,
size_t *poffset, size_t *plen);
-int textplain_find_line(struct content *c, unsigned offset);
-char *textplain_get_raw_data(struct content *c,
+int textplain_find_line(struct hlcache_handle *h, unsigned offset);
+char *textplain_get_raw_data(struct hlcache_handle *h,
unsigned start, unsigned end, size_t *plen);
#endif
13 years, 6 months
r10085 jmb - in /branches/jmb/new-cache/render: html.c html.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 09:19:03 2010
New Revision: 10085
URL: http://source.netsurf-browser.org?rev=10085&view=rev
Log:
html_get_favicon returns a hlcache_handle *
Modified:
branches/jmb/new-cache/render/html.c
branches/jmb/new-cache/render/html.h
Modified: branches/jmb/new-cache/render/html.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.c?re...
==============================================================================
--- branches/jmb/new-cache/render/html.c (original)
+++ branches/jmb/new-cache/render/html.c Sun Feb 28 09:19:03 2010
@@ -2198,7 +2198,7 @@
* \param h HTML document to retrieve favicon from
* \return Pointer to favicon, or NULL if none
*/
-struct content *html_get_favicon(hlcache_handle *h)
+hlcache_handle *html_get_favicon(hlcache_handle *h)
{
struct content *c = hlcache_handle_get_content(h);
Modified: branches/jmb/new-cache/render/html.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.h?re...
==============================================================================
--- branches/jmb/new-cache/render/html.h (original)
+++ branches/jmb/new-cache/render/html.h Sun Feb 28 09:19:03 2010
@@ -235,6 +235,6 @@
unsigned int *n);
struct content_html_object *html_get_objects(struct hlcache_handle *h,
unsigned int *n);
-struct content *html_get_favicon(struct hlcache_handle *h);
+struct hlcache_handle *html_get_favicon(struct hlcache_handle *h);
#endif
13 years, 6 months
r10084 jmb - in /branches/jmb/new-cache/image: ico.c ico.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 09:14:02 2010
New Revision: 10084
URL: http://source.netsurf-browser.org?rev=10084&view=rev
Log:
s/struct content/struct hlcache_handle/ in nsico_set_bitmap_from_size API
Modified:
branches/jmb/new-cache/image/ico.c
branches/jmb/new-cache/image/ico.h
Modified: branches/jmb/new-cache/image/ico.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/ico.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/ico.c (original)
+++ branches/jmb/new-cache/image/ico.c Sun Feb 28 09:14:02 2010
@@ -30,6 +30,7 @@
#include <libnsbmp.h>
#include "utils/config.h"
#include "content/content_protected.h"
+#include "content/hlcache.h"
#include "desktop/plotters.h"
#include "image/bitmap.h"
#include "image/ico.h"
@@ -119,14 +120,22 @@
/** sets the bitmap for an ico according to the dimensions */
-bool nsico_set_bitmap_from_size(struct content *c, int width, int height)
+bool nsico_set_bitmap_from_size(hlcache_handle *h, int width, int height)
{
- struct bmp_image *bmp = ico_find(c->data.ico.ico, width, height);
+ struct content *c = hlcache_handle_get_content(h);
+ struct bmp_image *bmp;
+
+ assert(c != NULL);
+
+ bmp = ico_find(c->data.ico.ico, width, height);
if (bmp == NULL)
return false;
+
if ((bmp->decoded == false) && (bmp_decode(bmp) != BMP_OK))
return false;
+
c->bitmap = bmp->bitmap;
+
return true;
}
Modified: branches/jmb/new-cache/image/ico.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/ico.h?rev=...
==============================================================================
--- branches/jmb/new-cache/image/ico.h (original)
+++ branches/jmb/new-cache/image/ico.h Sun Feb 28 09:14:02 2010
@@ -30,6 +30,7 @@
#include <libnsbmp.h>
struct content;
+struct hlcache_handle;
struct content_ico_data {
struct ico_collection *ico; /** ICO collection data */
@@ -47,7 +48,8 @@
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
float scale, colour background_colour,
bool repeat_x, bool repeat_y);
-bool nsico_set_bitmap_from_size(struct content *c, int width, int height);
+bool nsico_set_bitmap_from_size(struct hlcache_handle *h,
+ int width, int height);
#endif /* WITH_BMP */
13 years, 6 months
r10083 jmb - in /branches/jmb/new-cache/render: html.c html.h
by netsurf@semichrome.net
Author: jmb
Date: Sun Feb 28 09:09:56 2010
New Revision: 10083
URL: http://source.netsurf-browser.org?rev=10083&view=rev
Log:
Make html APIs called from desktop/ and above take hlcache_handle * instead of struct content *
Modified:
branches/jmb/new-cache/render/html.c
branches/jmb/new-cache/render/html.h
Modified: branches/jmb/new-cache/render/html.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.c?re...
==============================================================================
--- branches/jmb/new-cache/render/html.c (original)
+++ branches/jmb/new-cache/render/html.c Sun Feb 28 09:09:56 2010
@@ -32,6 +32,7 @@
#include "content/content_protected.h"
#include "content/fetch.h"
#include "content/fetchcache.h"
+#include "content/hlcache.h"
#include "desktop/browser.h"
#include "desktop/gui.h"
#include "desktop/options.h"
@@ -2040,11 +2041,14 @@
/**
* Retrieve HTML document tree
*
- * \param c HTML content to retrieve document tree from
+ * \param h HTML content to retrieve document tree from
* \return Pointer to document tree
*/
-xmlDoc *html_get_document(struct content *c)
-{
+xmlDoc *html_get_document(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.document;
@@ -2053,13 +2057,16 @@
/**
* Retrieve box tree
*
- * \param c HTML content to retrieve tree from
+ * \param h HTML content to retrieve tree from
* \return Pointer to box tree
*
* \todo This API must die, as must all use of the box tree outside render/
*/
-struct box *html_get_box_tree(struct content *c)
-{
+struct box *html_get_box_tree(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.layout;
@@ -2068,11 +2075,14 @@
/**
* Retrieve the charset of an HTML document
*
- * \param c Content to retrieve charset from
+ * \param h Content to retrieve charset from
* \return Pointer to charset, or NULL
*/
-const char *html_get_encoding(struct content *c)
-{
+const char *html_get_encoding(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.encoding;
@@ -2081,11 +2091,14 @@
/**
* Retrieve framesets used in an HTML document
*
- * \param c Content to inspect
+ * \param h Content to inspect
* \return Pointer to framesets, or NULL if none
*/
-struct content_html_frames *html_get_frameset(struct content *c)
-{
+struct content_html_frames *html_get_frameset(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.frameset;
@@ -2094,11 +2107,14 @@
/**
* Retrieve iframes used in an HTML document
*
- * \param c Content to inspect
+ * \param h Content to inspect
* \return Pointer to iframes, or NULL if none
*/
-struct content_html_iframe *html_get_iframe(struct content *c)
-{
+struct content_html_iframe *html_get_iframe(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.iframe;
@@ -2107,11 +2123,14 @@
/**
* Retrieve an HTML content's base URL
*
- * \param c Content to retrieve base target from
+ * \param h Content to retrieve base target from
* \return Pointer to URL
*/
-const char *html_get_base_url(struct content *c)
-{
+const char *html_get_base_url(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.base_url;
@@ -2120,11 +2139,14 @@
/**
* Retrieve an HTML content's base target
*
- * \param c Content to retrieve base target from
+ * \param h Content to retrieve base target from
* \return Pointer to target, or NULL if none
*/
-const char *html_get_base_target(struct content *c)
-{
+const char *html_get_base_target(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.base_target;
@@ -2133,12 +2155,15 @@
/**
* Retrieve stylesheets used by HTML document
*
- * \param c Content to retrieve stylesheets from
+ * \param h Content to retrieve stylesheets from
* \param n Pointer to location to receive number of sheets
* \return Pointer to array of stylesheets
*/
-struct html_stylesheet *html_get_stylesheets(struct content *c, unsigned int *n)
-{
+struct html_stylesheet *html_get_stylesheets(hlcache_handle *h, unsigned int *n)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
assert(n != NULL);
@@ -2150,12 +2175,15 @@
/**
* Retrieve objects used by HTML document
*
- * \param c Content to retrieve objects from
+ * \param h Content to retrieve objects from
* \param n Pointer to location to receive number of objects
* \return Pointer to array of objects
*/
-struct content_html_object *html_get_objects(struct content *c, unsigned int *n)
-{
+struct content_html_object *html_get_objects(hlcache_handle *h, unsigned int *n)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
assert(n != NULL);
@@ -2167,11 +2195,14 @@
/**
* Retrieve favicon associated with an HTML document
*
- * \param c HTML document to retrieve favicon from
+ * \param h HTML document to retrieve favicon from
* \return Pointer to favicon, or NULL if none
*/
-struct content *html_get_favicon(struct content *c)
-{
+struct content *html_get_favicon(hlcache_handle *h)
+{
+ struct content *c = hlcache_handle_get_content(h);
+
+ assert(c != NULL);
assert(c->type == CONTENT_HTML);
return c->data.html.favicon;
Modified: branches/jmb/new-cache/render/html.h
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.h?re...
==============================================================================
--- branches/jmb/new-cache/render/html.h (original)
+++ branches/jmb/new-cache/render/html.h Sun Feb 28 09:09:56 2010
@@ -36,6 +36,7 @@
struct rect;
struct browser_window;
struct content;
+struct hlcache_handle;
struct imagemap;
struct object_params;
struct plotters;
@@ -223,17 +224,17 @@
float scale,
bool excluded);
-xmlDoc *html_get_document(struct content *c);
-struct box *html_get_box_tree(struct content *c);
-const char *html_get_encoding(struct content *c);
-struct content_html_frames *html_get_frameset(struct content *c);
-struct content_html_iframe *html_get_iframe(struct content *c);
-const char *html_get_base_url(struct content *c);
-const char *html_get_base_target(struct content *c);
-struct html_stylesheet *html_get_stylesheets(struct content *c,
+xmlDoc *html_get_document(struct hlcache_handle *h);
+struct box *html_get_box_tree(struct hlcache_handle *h);
+const char *html_get_encoding(struct hlcache_handle *h);
+struct content_html_frames *html_get_frameset(struct hlcache_handle *h);
+struct content_html_iframe *html_get_iframe(struct hlcache_handle *h);
+const char *html_get_base_url(struct hlcache_handle *h);
+const char *html_get_base_target(struct hlcache_handle *h);
+struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h,
unsigned int *n);
-struct content_html_object *html_get_objects(struct content *c,
+struct content_html_object *html_get_objects(struct hlcache_handle *h,
unsigned int *n);
-struct content *html_get_favicon(struct content *c);
+struct content *html_get_favicon(struct hlcache_handle *h);
#endif
13 years, 6 months
r10082 jmb - in /branches/jmb/new-cache: css/css.c image/bmp.c image/gif.c image/ico.c image/jpeg.c image/mng.c image/nssprite.c image/png.c render/box.c render/box_construct.c render/directory.c render/favicon.c render/html.c render/textplain.c
by netsurf@semichrome.net
Author: jmb
Date: Wed Feb 24 19:10:32 2010
New Revision: 10082
URL: http://source.netsurf-browser.org?rev=10082&view=rev
Log:
Make content handlers use protected content API
Modified:
branches/jmb/new-cache/css/css.c
branches/jmb/new-cache/image/bmp.c
branches/jmb/new-cache/image/gif.c
branches/jmb/new-cache/image/ico.c
branches/jmb/new-cache/image/jpeg.c
branches/jmb/new-cache/image/mng.c
branches/jmb/new-cache/image/nssprite.c
branches/jmb/new-cache/image/png.c
branches/jmb/new-cache/render/box.c
branches/jmb/new-cache/render/box_construct.c
branches/jmb/new-cache/render/directory.c
branches/jmb/new-cache/render/favicon.c
branches/jmb/new-cache/render/html.c
branches/jmb/new-cache/render/textplain.c
Modified: branches/jmb/new-cache/css/css.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/css/css.c?rev=10...
==============================================================================
--- branches/jmb/new-cache/css/css.c (original)
+++ branches/jmb/new-cache/css/css.c Wed Feb 24 19:10:32 2010
@@ -77,7 +77,7 @@
charset = c->fallback_charset;
}
- if (nscss_create_css_data(&c->data.css, c->dict, content_get_url(c),
+ if (nscss_create_css_data(&c->data.css, c->dict, content__get_url(c),
charset, origin, media, c->quirks) != NSERROR_OK) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
Modified: branches/jmb/new-cache/image/bmp.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/bmp.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/bmp.c (original)
+++ branches/jmb/new-cache/image/bmp.c Wed Feb 24 19:10:32 2010
@@ -76,7 +76,7 @@
/* set the bmp data */
bmp = c->data.bmp.bmp;
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
/* analyse the BMP */
res = bmp_analyse(bmp, size, (unsigned char *) data);
Modified: branches/jmb/new-cache/image/gif.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/gif.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/gif.c (original)
+++ branches/jmb/new-cache/image/gif.c Wed Feb 24 19:10:32 2010
@@ -90,7 +90,7 @@
/* Get the animation */
gif = c->data.gif.gif;
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
/* Initialise the GIF */
do {
Modified: branches/jmb/new-cache/image/ico.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/ico.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/ico.c (original)
+++ branches/jmb/new-cache/image/ico.c Wed Feb 24 19:10:32 2010
@@ -63,7 +63,7 @@
/* set the ico data */
ico = c->data.ico.ico;
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
/* analyse the ico */
res = ico_analyse(ico, size, (unsigned char *) data);
Modified: branches/jmb/new-cache/image/jpeg.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/jpeg.c?rev...
==============================================================================
--- branches/jmb/new-cache/image/jpeg.c (original)
+++ branches/jmb/new-cache/image/jpeg.c Wed Feb 24 19:10:32 2010
@@ -92,7 +92,7 @@
const char *data;
unsigned long size;
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = nsjpeg_error_exit;
Modified: branches/jmb/new-cache/image/mng.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/mng.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/mng.c (original)
+++ branches/jmb/new-cache/image/mng.c Wed Feb 24 19:10:32 2010
@@ -192,7 +192,7 @@
/* Copy any data we have (maximum of 'size')
*/
- data = content_get_source_data(c, &data_size);
+ data = content__get_source_data(c, &data_size);
*bytesread = ((data_size - c->data.mng.read_size) < size) ?
(data_size - c->data.mng.read_size) : size;
@@ -309,7 +309,7 @@
assert(c != NULL);
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
/* by this point, the png should have been parsed
* and the bitmap created, so ensure that's the case
@@ -665,7 +665,7 @@
chunk[4] = '\0';
LOG(("error playing '%s' chunk %s (%d):",
- content_get_url(c), chunk, chunkseq));
+ content__get_url(c), chunk, chunkseq));
LOG(("code %d severity %d extra1 %d extra2 %d text:'%s'", code,
severity, extra1, extra2, text));
Modified: branches/jmb/new-cache/image/nssprite.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/nssprite.c...
==============================================================================
--- branches/jmb/new-cache/image/nssprite.c (original)
+++ branches/jmb/new-cache/image/nssprite.c Wed Feb 24 19:10:32 2010
@@ -65,7 +65,7 @@
const char *data;
unsigned long size;
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
ERRCHK(rosprite_create_mem_context((uint8_t *) data, size, &ctx));
Modified: branches/jmb/new-cache/image/png.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/image/png.c?rev=...
==============================================================================
--- branches/jmb/new-cache/image/png.c (original)
+++ branches/jmb/new-cache/image/png.c Wed Feb 24 19:10:32 2010
@@ -258,7 +258,7 @@
assert(c->data.png.png != NULL);
assert(c->data.png.info != NULL);
- data = content_get_source_data(c, &size);
+ data = content__get_source_data(c, &size);
png_destroy_read_struct(&c->data.png.png, &c->data.png.info, 0);
Modified: branches/jmb/new-cache/render/box.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/box.c?rev...
==============================================================================
--- branches/jmb/new-cache/render/box.c (original)
+++ branches/jmb/new-cache/render/box.c Wed Feb 24 19:10:32 2010
@@ -663,8 +663,10 @@
(int) box->length, box->text);
if (box->space)
fprintf(stream, "space ");
- if (box->object)
- fprintf(stream, "(object '%s') ", content_get_url(box->object));
+ if (box->object) {
+ fprintf(stream, "(object '%s') ",
+ content__get_url(box->object));
+ }
if (box->gadget)
fprintf(stream, "(gadget) ");
if (box->style)
Modified: branches/jmb/new-cache/render/box_construct.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/box_const...
==============================================================================
--- branches/jmb/new-cache/render/box_construct.c (original)
+++ branches/jmb/new-cache/render/box_construct.c Wed Feb 24 19:10:32 2010
@@ -841,7 +841,7 @@
if ((s = (char *) xmlGetProp(n, (const xmlChar *) "style"))) {
inline_style = nscss_create_inline_style(
(uint8_t *) s, strlen(s),
- c->data.html.encoding, content_get_url(c),
+ c->data.html.encoding, content__get_url(c),
c->data.html.quirks != BINDING_QUIRKS_MODE_NONE,
c->data.html.dict, myrealloc, c);
Modified: branches/jmb/new-cache/render/directory.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/directory...
==============================================================================
--- branches/jmb/new-cache/render/directory.c (original)
+++ branches/jmb/new-cache/render/directory.c Wed Feb 24 19:10:32 2010
@@ -63,7 +63,7 @@
bool compare;
char *up;
- path = url_to_path(content_get_url(c));
+ path = url_to_path(content__get_url(c));
if (!path) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
@@ -99,9 +99,9 @@
binding_parse_chunk(c->data.html.parser_binding,
(uint8_t *) buffer, strlen(buffer));
- res = url_parent(content_get_url(c), &up);
+ res = url_parent(content__get_url(c), &up);
if (res == URL_FUNC_OK) {
- res = url_compare(content_get_url(c), up, false, &compare);
+ res = url_compare(content__get_url(c), up, false, &compare);
if ((res == URL_FUNC_OK) && !compare) {
snprintf(buffer, sizeof(buffer),
"<a href=\"..\">[..]</a>\n");
@@ -123,7 +123,7 @@
continue;
snprintf(buffer, sizeof(buffer), "<a href=\"%s/%s\">%s</a>\n",
- content_get_url(c), entry->d_name,
+ content__get_url(c), entry->d_name,
entry->d_name);
binding_parse_chunk(c->data.html.parser_binding,
Modified: branches/jmb/new-cache/render/favicon.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/favicon.c...
==============================================================================
--- branches/jmb/new-cache/render/favicon.c (original)
+++ branches/jmb/new-cache/render/favicon.c Wed Feb 24 19:10:32 2010
@@ -154,7 +154,7 @@
c->data.html.favicon = favcontent;
- fetchcache_go(favcontent, content_get_url(c),
+ fetchcache_go(favcontent, content__get_url(c),
favicon_callback, (intptr_t) c, 0,
c->width, c->height, 0, 0, false, c);
@@ -193,7 +193,7 @@
if (*type == CONTENT_UNKNOWN) {
c->data.html.favicon = 0;
- LOG(("%s is not a favicon", content_get_url(icon)));
+ LOG(("%s is not a favicon", content__get_url(icon)));
content_add_error(c, "NotFavIco", 0);
html_set_status(c, messages_get("NotFavIco"));
content_broadcast(c, CONTENT_MSG_STATUS, data);
@@ -213,14 +213,14 @@
break;
case CONTENT_MSG_DONE:
- LOG(("got favicon '%s'", content_get_url(icon)));
+ LOG(("got favicon '%s'", content__get_url(icon)));
break;
case CONTENT_MSG_LAUNCH:
/* Fall through */
case CONTENT_MSG_ERROR:
LOG(("favicon %s failed: %s",
- content_get_url(icon), data.error));
+ content__get_url(icon), data.error));
/* The favicon we were fetching may have been
* redirected, in that case, the object pointers
* will differ, so ensure that the object that's
Modified: branches/jmb/new-cache/render/html.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/html.c?re...
==============================================================================
--- branches/jmb/new-cache/render/html.c (original)
+++ branches/jmb/new-cache/render/html.c Wed Feb 24 19:10:32 2010
@@ -126,7 +126,7 @@
html->document = 0;
html->quirks = BINDING_QUIRKS_MODE_NONE;
html->encoding = 0;
- html->base_url = (char *) content_get_url(c);
+ html->base_url = (char *) content__get_url(c);
html->base_target = NULL;
html->layout = 0;
html->background_colour = NS_TRANSPARENT;
@@ -297,7 +297,7 @@
const char *source_data;
unsigned long source_size;
- source_data = content_get_source_data(c, &source_size);
+ source_data = content__get_source_data(c, &source_size);
/* Recurse to reprocess all that data. This is safe because
* the encoding is now specified at parser-start which means
@@ -332,7 +332,7 @@
struct form *f;
/* finish parsing */
- content_get_source_data(c, &size);
+ content__get_source_data(c, &size);
if (size == 0) {
/* Destroy current binding */
binding_destroy_tree(c->data.html.parser_binding);
@@ -697,7 +697,7 @@
/* Just delay specified, so refresh current page */
xmlFree(content);
- c->refresh = talloc_strdup(c, content_get_url(c));
+ c->refresh = talloc_strdup(c, content__get_url(c));
if (!c->refresh) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c,
@@ -848,7 +848,7 @@
goto no_memory;
c->active++;
fetchcache_go(c->data.html.stylesheets[STYLESHEET_BASE].data.external,
- content_get_url(c),
+ content__get_url(c),
html_convert_css_callback, (intptr_t) c,
STYLESHEET_BASE, c->width, c->height,
0, 0, false, c);
@@ -865,7 +865,7 @@
c->active++;
fetchcache_go(c->data.html.stylesheets[STYLESHEET_QUIRKS].
data.external,
- content_get_url(c), html_convert_css_callback,
+ content__get_url(c), html_convert_css_callback,
(intptr_t) c, STYLESHEET_QUIRKS, c->width,
c->height, 0, 0, false, c);
}
@@ -882,7 +882,7 @@
c->active++;
fetchcache_go(c->data.html.stylesheets[STYLESHEET_ADBLOCK].
data.external,
- content_get_url(c), html_convert_css_callback,
+ content__get_url(c), html_convert_css_callback,
(intptr_t) c, STYLESHEET_ADBLOCK, c->width,
c->height, 0, 0, false, c);
}
@@ -994,7 +994,7 @@
c->active++;
fetchcache_go(c->data.html.stylesheets[i].data.external,
- content_get_url(c),
+ content__get_url(c),
html_convert_css_callback,
(intptr_t) c, i, c->width, c->height,
0, 0, false, c);
@@ -1307,7 +1307,7 @@
c->active++;
/* start fetch */
- fetchcache_go(c_fetch, content_get_url(c),
+ fetchcache_go(c_fetch, content__get_url(c),
html_object_callback, (intptr_t) c, i,
available_width, available_height,
0, 0, false, c);
@@ -1374,7 +1374,7 @@
}
/* start fetch */
- fetchcache_go(c_fetch, content_get_url(c),
+ fetchcache_go(c_fetch, content__get_url(c),
html_object_callback, (intptr_t) c, i,
c->data.html.object[i].box->width,
c->data.html.object[i].box->height,
Modified: branches/jmb/new-cache/render/textplain.c
URL: http://source.netsurf-browser.org/branches/jmb/new-cache/render/textplain...
==============================================================================
--- branches/jmb/new-cache/render/textplain.c (original)
+++ branches/jmb/new-cache/render/textplain.c Wed Feb 24 19:10:32 2010
@@ -143,7 +143,7 @@
const char *source_data;
unsigned long source_size;
- source_data = content_get_source_data(c, &source_size);
+ source_data = content__get_source_data(c, &source_size);
do {
char *inbuf = (char *) source_data +
13 years, 7 months