2015-05-03 18:10:15 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
|
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NETSURF_CSS_HINTS_H_
|
|
|
|
#define NETSURF_CSS_HINTS_H_
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2016-05-26 13:18:41 +03:00
|
|
|
#include <libcss/libcss.h>
|
2015-05-03 18:10:15 +03:00
|
|
|
|
2015-07-08 23:55:12 +03:00
|
|
|
nserror css_hint_init(void);
|
|
|
|
void css_hint_fini(void);
|
2015-05-03 18:10:15 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback to retrieve presentational hints for a node
|
|
|
|
*
|
2016-05-06 00:41:03 +03:00
|
|
|
* \param[in] pw HTML document
|
|
|
|
* \param[in] node DOM node
|
2016-05-26 13:18:41 +03:00
|
|
|
* \param[out] nhints number of hints retrived
|
2016-05-06 00:41:03 +03:00
|
|
|
* \param[out] hints retrived hints
|
2015-05-03 18:10:15 +03:00
|
|
|
* \return CSS_OK on success,
|
|
|
|
* CSS_PROPERTY_NOT_SET if there is no hint for the requested property,
|
|
|
|
* CSS_NOMEM on memory exhaustion.
|
|
|
|
*/
|
|
|
|
css_error node_presentational_hint(
|
|
|
|
void *pw,
|
|
|
|
void *node,
|
2015-07-08 23:55:12 +03:00
|
|
|
uint32_t *nhints,
|
|
|
|
css_hint **hints);
|
2015-05-03 18:10:15 +03:00
|
|
|
|
2016-05-26 13:18:41 +03:00
|
|
|
/**
|
|
|
|
* Parser for colours specified in attribute values.
|
|
|
|
*
|
|
|
|
* \param data Data to parse (NUL-terminated)
|
|
|
|
* \param result Pointer to location to receive resulting css_color
|
|
|
|
* \return true on success, false on invalid input
|
|
|
|
*/
|
2015-05-03 18:10:15 +03:00
|
|
|
bool nscss_parse_colour(const char *data, css_color *result);
|
|
|
|
|
|
|
|
#endif
|