Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
  3.  *
  4.  * This file is part of NetSurf, http://www.netsurf-browser.org/
  5.  *
  6.  * NetSurf is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; version 2 of the License.
  9.  *
  10.  * NetSurf is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17.  */
  18.  
  19. #ifndef NETSURF_CSS_SELECT_H_
  20. #define NETSURF_CSS_SELECT_H_
  21.  
  22. #include <stdint.h>
  23.  
  24. #include <dom/dom.h>
  25.  
  26. #include "css/css.h"
  27. #include "utils/nsurl.h"
  28.  
  29. struct content;
  30.  
  31. /**
  32.  * Selection context
  33.  */
  34. typedef struct nscss_select_ctx
  35. {
  36.         css_select_ctx *ctx;
  37.         bool quirks;
  38.         nsurl *base_url;
  39.         lwc_string *universal;
  40. } nscss_select_ctx;
  41.  
  42. css_stylesheet *nscss_create_inline_style(const uint8_t *data, size_t len,
  43.                 const char *charset, const char *url, bool allow_quirks,
  44.                 css_allocator_fn alloc, void *pw);
  45.  
  46. css_select_results *nscss_get_style(nscss_select_ctx *ctx, dom_node *n,
  47.                 uint64_t media, const css_stylesheet *inline_style,
  48.                 css_allocator_fn alloc, void *pw);
  49.  
  50. css_computed_style *nscss_get_blank_style(nscss_select_ctx *ctx,
  51.                 const css_computed_style *parent,
  52.                 css_allocator_fn alloc, void *pw);
  53.  
  54. css_error nscss_compute_font_size(void *pw, const css_hint *parent,
  55.                 css_hint *size);
  56.  
  57. bool nscss_parse_colour(const char *data, css_color *result);
  58.  
  59. #endif
  60.