summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/content.c15
-rw-r--r--content/content.h10
2 files changed, 18 insertions, 7 deletions
diff --git a/content/content.c b/content/content.c
index 1d6e32a8b..9259e952d 100644
--- a/content/content.c
+++ b/content/content.c
@@ -163,7 +163,8 @@ struct handler_entry {
int clip_x0, int clip_y0, int clip_x1, int clip_y1,
float scale, unsigned long background_colour);
void (*open)(struct content *c, struct browser_window *bw,
- struct content *page, struct box *box,
+ struct content *page, unsigned int index,
+ struct box *box,
struct object_params *params);
void (*close)(struct content *c);
/** There must be one content per user for this type. */
@@ -928,18 +929,26 @@ void content_stop_check(struct content *c)
/**
* A window containing the content has been opened.
*
+ * \param c content that has been opened
+ * \param bw browser window containing the content
+ * \param page content of type CONTENT_HTML containing c, or 0 if not an
+ * object within a page
+ * \param index index in page->data.html.object, or 0 if not an object
+ * \param box box containing c, or 0 if not an object
+ * \param params object parameters, or 0 if not an object
+ *
* Calls the open function for the content.
*/
void content_open(struct content *c, struct browser_window *bw,
- struct content *page, struct box *box,
+ struct content *page, unsigned int index, struct box *box,
struct object_params *params)
{
assert(c != 0);
assert(c->type < CONTENT_UNKNOWN);
LOG(("content %s", c->url));
if (handler_map[c->type].open)
- handler_map[c->type].open(c, bw, page, box, params);
+ handler_map[c->type].open(c, bw, page, index, box, params);
}
diff --git a/content/content.h b/content/content.h
index edb9fe0d7..f71691fc7 100644
--- a/content/content.h
+++ b/content/content.h
@@ -20,9 +20,11 @@
* Contents have an associated set of users, which are informed by a callback
* when the state of the content changes or something interesting happens.
*
- * Optionally, contents may have instances (depending on type). Instances
- * represent copies of the same URL, for example if a page is open in two
- * windows, or a page contains the same image twice.
+ * Depending on the type of content, there may be either one content structure
+ * per URL which is shared among all users, or one per URL per user. For
+ * example, CONTENT_JPEGs are shared, while there is one CONTENT_HTML per user
+ * (because each instance of an HTML page may have different parameters such as
+ * window width). This is controlled by no_share in ::handler_map.
*
* The status of a content follows a fixed order. Certain content functions
* change the state, and each change of state results in a message to all users
@@ -305,7 +307,7 @@ void content_stop(struct content *c,
intptr_t p1, intptr_t p2, union content_msg_data data),
intptr_t p1, intptr_t p2);
void content_open(struct content *c, struct browser_window *bw,
- struct content *page, struct box *box,
+ struct content *page, unsigned int index, struct box *box,
struct object_params *params);
void content_close(struct content *c);
void content_add_error(struct content *c, const char *token,