diff options
author | James Bursa <james@netsurf-browser.org> | 2006-10-04 22:25:33 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2006-10-04 22:25:33 +0000 |
commit | bac1be667ab31c8cb39a9f46d90d70e0d5bba009 (patch) | |
tree | f98a18cc1ffe46775b9ff26d8c776024b59b01ba /Docs | |
parent | 265db19c266fed501d85b40f86e3f83af8d922e4 (diff) | |
download | netsurf-bac1be667ab31c8cb39a9f46d90d70e0d5bba009.tar.gz netsurf-bac1be667ab31c8cb39a9f46d90d70e0d5bba009.tar.bz2 |
Introduction to content structures.
svn path=/trunk/netsurf/; revision=2978
Diffstat (limited to 'Docs')
-rw-r--r-- | Docs/01-content | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/Docs/01-content b/Docs/01-content index 4db4bade8..3cfc47d86 100644 --- a/Docs/01-content +++ b/Docs/01-content @@ -4,21 +4,38 @@ Fetching, managing, and converting content The modules in the content directory provide the infrastructure for fetching data, managing it in memory, and converting it for display. -Struct Content --------------- -Each URL is stored in a struct ::content. This structure contains the -content_type and a union with fields for each type of data (HTML, CSS, -images). The content_* functions provide a general interface for handling these -structures. For example, content_redraw() calls html_redraw() or -nsjpeg_redraw(), etc., depending on the type of content. See content.h and -content.c. - -Fetching +Contents -------- +The data related to each URL used by NetSurf is stored in a 'struct content' +(known as a "content"). A content contains + +* a 'content type' which corresponds to the MIME type of the URL (for example + CONTENT_HTML, CONTENT_JPEG, or CONTENT_OTHER) +* type independent data such as the URL and raw source bytes +* a union of structs for type dependent data (for example 'struct + content_html_data') + +Contents are stored in a global linked list 'content_list', also known as the +"memory cache". + +The content_* functions provide a general interface for handling these +structures. They use a table of handlers to call type-specific code. For +example, content_redraw() may call html_redraw() or nsjpeg_redraw() depending on +the type of content. + +Each content has a list of users. A user is a callback function which is called +when something interesting happens to the content (for example, it's ready to be +displayed). Examples of users are browser windows (of HTML contents) and HTML +contents (of JPEG contents). + +Some content types may not be shared among users: an HTML content is dependent +on the width of the window, so sharing by two or more windows wouldn't work. +Thus there may be more than one content with the same URL in memory. + +Creating and fetching contents +------------------------------ A high-level interface to starting the process of fetching and converting an URL is provided by the fetchcache functions, which check the memory cache for a url -and fetch, convert, and cache it if not present. See fetchcache.h and -fetchcache.c. +and fetch, convert, and cache it if not present. -The fetch module provides a low-level URL fetching interface. See fetch.h and -fetch.c. +The fetch module provides a low-level URL fetching interface. |