summaryrefslogtreecommitdiff
path: root/src/select/computed.h
blob: d59fbe3e94076827eaa7c5c24f178469c6b5f237 (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
/*
 * This file is part of LibCSS
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
 */

#ifndef css_select_computed_h_
#define css_select_computed_h_

#include <libcss/computed.h>
#include <libcss/hint.h>
#include "autogenerated_computed.h"

/**
 * Take a new reference to a computed style
 *
 * \param style  The style to take a new reference to.
 * \return The new computed style reference
 */
static inline css_computed_style * css__computed_style_ref(
		css_computed_style *style)
{
	if (style == NULL)
		return NULL;

	if (style->i.uncommon != NULL) {
		style->i.uncommon->count++;
	}

	style->count++;
	return style;
}

css_error css__computed_style_create(css_computed_style **result);

css_error css__computed_style_initialise(css_computed_style *style,
		struct css_select_handler *handler, void *pw);


css_error css__computed_uncommon_destroy(css_computed_uncommon *uncommon);

css_error css__compute_absolute_values(const css_computed_style *parent,
		css_computed_style *style,
		css_error (*compute_font_size)(void *pw,
			const css_hint *parent, css_hint *size),
		void *pw);

#endif