summaryrefslogtreecommitdiff
path: root/riscos/htmlinstance.c
blob: 68c03fdeb32b755695b82f8a94d8796b88d57158 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * This file is part of NetSurf, http://netsurf.sourceforge.net/
 * Licensed under the GNU General Public License,
 *                http://www.opensource.org/licenses/gpl-license
 * Copyright 2003 James Bursa <bursa@users.sourceforge.net>
 */

#include "netsurf/utils/config.h"
#include "netsurf/content/content.h"
#include "netsurf/desktop/browser.h"
#include "netsurf/render/box.h"
#include "netsurf/render/html.h"
#include "netsurf/riscos/frames.h"
#include "netsurf/utils/log.h"

void html_add_instance(struct content *c, struct browser_window *bw,
		struct content *page, struct box *box,
		struct object_params *params, void **state)
{
	unsigned int i;
	for (i = 0; i != c->data.html.object_count; i++) {
		if (c->data.html.object[i].content == 0)
			continue;
#ifdef WITH_FRAMES
		if (c->data.html.object[i].content->type == CONTENT_HTML)
		        frame_add_instance(c->data.html.object[i].content,
				bw, c,
				c->data.html.object[i].box,
				c->data.html.object[i].box->object_params,
				&c->data.html.object[i].box->object_state);
		else
#endif
                	content_add_instance(c->data.html.object[i].content,
				bw, c,
				c->data.html.object[i].box,
				c->data.html.object[i].box->object_params,
				&c->data.html.object[i].box->object_state);
	}
}


void html_reshape_instance(struct content *c, struct browser_window *bw,
		struct content *page, struct box *box,
		struct object_params *params, void **state)
{
	unsigned int i;
	for (i = 0; i != c->data.html.object_count; i++) {
		if (c->data.html.object[i].content == 0)
			continue;
#ifdef WITH_FRAMES
		if (c->data.html.object[i].content->type == CONTENT_HTML)
		        frame_reshape_instance(c->data.html.object[i].content,
				bw, c,
				c->data.html.object[i].box,
				c->data.html.object[i].box->object_params,
				&c->data.html.object[i].box->object_state);
		else
#endif
		        content_reshape_instance(c->data.html.object[i].content,
				bw, c,
				c->data.html.object[i].box,
				c->data.html.object[i].box->object_params,
				&c->data.html.object[i].box->object_state);
	}
}

void html_remove_instance(struct content *c, struct browser_window *bw,
		struct content *page, struct box *box,
		struct object_params *params, void **state)
{
	unsigned int i;
	for (i = 0; i != c->data.html.object_count; i++) {
		if (c->data.html.object[i].content == 0)
			continue;
#ifdef WITH_FRAMES
		if (c->data.html.object[i].content->type == CONTENT_HTML)
		        frame_remove_instance(c->data.html.object[i].content,
				bw, c,
				c->data.html.object[i].box,
				c->data.html.object[i].box->object_params,
				&c->data.html.object[i].box->object_state);
		else
#endif
                	content_remove_instance(c->data.html.object[i].content,
				bw, c,
				c->data.html.object[i].box,
				c->data.html.object[i].box->object_params,
				&c->data.html.object[i].box->object_state);
	}
}