XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
css.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
Include dependency graph for css.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NsCssAttr
 
struct  NsCssNode
 
struct  NsCssBoxStyle
 
struct  NsCssUsed
 

Macros

#define NS_CSS_MAX_CLASSES   8
 
#define NS_CSS_CLASS_LEN   31
 
#define NS_CSS_ID_LEN   63
 
#define NS_CSS_TAG_LEN   15
 
#define NS_CSS_MAX_ATTRS   24
 
#define NS_CSS_ATTR_NAME_LEN   31
 
#define NS_DISPLAY_INLINE   0
 
#define NS_DISPLAY_BLOCK   1
 
#define NS_DISPLAY_LIST_ITEM   2
 
#define NS_DISPLAY_NONE   3
 
#define NS_DISPLAY_INLINE_BLOCK   4
 
#define NS_DISPLAY_TABLE_ROW   5
 
#define NS_DISPLAY_TABLE_CELL   6
 
#define NS_DISPLAY_FLEX_ROW   7
 
#define NS_POS_STATIC   0
 
#define NS_POS_ABSOLUTE   1
 
#define NS_POS_FIXED   2
 
#define NS_POS_RELATIVE   3
 
#define NS_CSS_BOLD   1
 
#define NS_CSS_ITALIC   2
 
#define NS_CSS_UNDER   4
 
#define NS_CSS_STRIKE   8
 
#define NS_CSS_OVER   16
 

Typedefs

typedef struct NsCssAttr NsCssAttr
 
typedef struct NsCssNode NsCssNode
 
typedef struct NsCssBoxStyle NsCssBoxStyle
 
typedef struct NsCssUsed NsCssUsed
 

Functions

int NsCssBegin (void)
 
void NsCssSetViewport (int width, int height)
 
int NsCssAddSheet (const char *data, size_t len)
 
void NsCssEnd (void)
 
NsCssNode * NsCssNodeCreate (NsCssNode *parent, const char *tag)
 
NsCssNode * NsCssNodeCreateText (NsCssNode *parent, const char *text, size_t len)
 
void NsCssNodeAppendChild (NsCssNode *parent, NsCssNode *child)
 
void NsCssNodeAddAttribute (NsCssNode *n, const char *name, const char *value)
 
const char * NsCssNodeAttr (NsCssNode *n, const char *name)
 
void NsCssNodeAddClass (NsCssNode *n, const char *cls)
 
void NsCssNodeSetId (NsCssNode *n, const char *id)
 
void NsCssNodeSetLink (NsCssNode *n, bool link)
 
int NsCssNodeSetInline (NsCssNode *n, const char *style)
 
NsCssNode * NsCssNodeById (NsCssNode *n, const char *id)
 
void NsCssReselectTree (NsCssNode *n)
 
int NsCssSelect (NsCssNode *n)
 
void NsCssNodeDestroy (NsCssNode *n)
 
void NsCssNodeDestroyTree (NsCssNode *n)
 
void NsCssNodeBoxStyle (NsCssNode *n, int base_width, int base_height, int viewport_w, int viewport_h, NsCssBoxStyle *out)
 
uint32_t NsCssNodeColor (NsCssNode *n)
 
int NsCssNodeFontPx (NsCssNode *n)
 
int NsCssNodeMarginLines (NsCssNode *n)
 
int NsCssNodeSkip (NsCssNode *n)
 
int NsCssNodeCenter (NsCssNode *n)
 
int NsCssNodeBlock (NsCssNode *n)
 
uint32_t NsCssNodeBackground (NsCssNode *n)
 
void NsCssNodeUsed (NsCssNode *n, NsCssUsed *out)
 

Macro Definition Documentation

◆ NS_CSS_ATTR_NAME_LEN

#define NS_CSS_ATTR_NAME_LEN   31

◆ NS_CSS_BOLD

#define NS_CSS_BOLD   1

◆ NS_CSS_CLASS_LEN

#define NS_CSS_CLASS_LEN   31

◆ NS_CSS_ID_LEN

#define NS_CSS_ID_LEN   63

◆ NS_CSS_ITALIC

#define NS_CSS_ITALIC   2

◆ NS_CSS_MAX_ATTRS

#define NS_CSS_MAX_ATTRS   24

◆ NS_CSS_MAX_CLASSES

#define NS_CSS_MAX_CLASSES   8

NetSurf CSS wrapper for XenevaOS (Phase 1+2).

Thin element tree + libcss select client. The HTML pass builds NsCssNodes as it scans tags; each node is selected against the UA + author sheets on open (ancestors are always selected first, so inheritance composes). Inline style="" attributes parse to per-node author sheets.

Exposes only what the readability renderer needs: text color (0xAARRGGBB, libcss css_color layout matches Chitralekha pixels), font size in px, and extra blank lines from vertical margins.

◆ NS_CSS_OVER

#define NS_CSS_OVER   16

◆ NS_CSS_STRIKE

#define NS_CSS_STRIKE   8

◆ NS_CSS_TAG_LEN

#define NS_CSS_TAG_LEN   15

◆ NS_CSS_UNDER

#define NS_CSS_UNDER   4

◆ NS_DISPLAY_BLOCK

#define NS_DISPLAY_BLOCK   1

◆ NS_DISPLAY_FLEX_ROW

#define NS_DISPLAY_FLEX_ROW   7

◆ NS_DISPLAY_INLINE

#define NS_DISPLAY_INLINE   0

◆ NS_DISPLAY_INLINE_BLOCK

#define NS_DISPLAY_INLINE_BLOCK   4

◆ NS_DISPLAY_LIST_ITEM

#define NS_DISPLAY_LIST_ITEM   2

◆ NS_DISPLAY_NONE

#define NS_DISPLAY_NONE   3

◆ NS_DISPLAY_TABLE_CELL

#define NS_DISPLAY_TABLE_CELL   6

◆ NS_DISPLAY_TABLE_ROW

#define NS_DISPLAY_TABLE_ROW   5

◆ NS_POS_ABSOLUTE

#define NS_POS_ABSOLUTE   1

◆ NS_POS_FIXED

#define NS_POS_FIXED   2

◆ NS_POS_RELATIVE

#define NS_POS_RELATIVE   3

◆ NS_POS_STATIC

#define NS_POS_STATIC   0

Typedef Documentation

◆ NsCssAttr

typedef struct NsCssAttr NsCssAttr

◆ NsCssBoxStyle

typedef struct NsCssBoxStyle NsCssBoxStyle

◆ NsCssNode

typedef struct NsCssNode NsCssNode

◆ NsCssUsed

typedef struct NsCssUsed NsCssUsed

Function Documentation

◆ NsCssAddSheet()

int NsCssAddSheet ( const char *  data,
size_t  len 
)

◆ NsCssBegin()

int NsCssBegin ( void  )

◆ NsCssEnd()

void NsCssEnd ( void  )

◆ NsCssNodeAddAttribute()

void NsCssNodeAddAttribute ( NsCssNode *  n,
const char *  name,
const char *  value 
)

◆ NsCssNodeAddClass()

void NsCssNodeAddClass ( NsCssNode *  n,
const char *  cls 
)

◆ NsCssNodeAppendChild()

void NsCssNodeAppendChild ( NsCssNode *  parent,
NsCssNode *  child 
)

◆ NsCssNodeAttr()

const char * NsCssNodeAttr ( NsCssNode *  n,
const char *  name 
)

◆ NsCssNodeBackground()

uint32_t NsCssNodeBackground ( NsCssNode *  n)

◆ NsCssNodeBlock()

int NsCssNodeBlock ( NsCssNode *  n)

◆ NsCssNodeBoxStyle()

void NsCssNodeBoxStyle ( NsCssNode *  n,
int  base_width,
int  base_height,
int  viewport_w,
int  viewport_h,
NsCssBoxStyle *  out 
)

◆ NsCssNodeById()

NsCssNode * NsCssNodeById ( NsCssNode *  n,
const char *  id 
)

◆ NsCssNodeCenter()

int NsCssNodeCenter ( NsCssNode *  n)

◆ NsCssNodeColor()

uint32_t NsCssNodeColor ( NsCssNode *  n)

◆ NsCssNodeCreate()

NsCssNode * NsCssNodeCreate ( NsCssNode *  parent,
const char *  tag 
)

◆ NsCssNodeCreateText()

NsCssNode * NsCssNodeCreateText ( NsCssNode *  parent,
const char *  text,
size_t  len 
)

◆ NsCssNodeDestroy()

void NsCssNodeDestroy ( NsCssNode *  n)

◆ NsCssNodeDestroyTree()

void NsCssNodeDestroyTree ( NsCssNode *  n)

◆ NsCssNodeFontPx()

int NsCssNodeFontPx ( NsCssNode *  n)

◆ NsCssNodeMarginLines()

int NsCssNodeMarginLines ( NsCssNode *  n)

◆ NsCssNodeSetId()

void NsCssNodeSetId ( NsCssNode *  n,
const char *  id 
)

◆ NsCssNodeSetInline()

int NsCssNodeSetInline ( NsCssNode *  n,
const char *  style 
)

◆ NsCssNodeSetLink()

void NsCssNodeSetLink ( NsCssNode *  n,
bool  link 
)

◆ NsCssNodeSkip()

int NsCssNodeSkip ( NsCssNode *  n)

◆ NsCssNodeUsed()

void NsCssNodeUsed ( NsCssNode *  n,
NsCssUsed *  out 
)

◆ NsCssReselectTree()

void NsCssReselectTree ( NsCssNode *  n)

◆ NsCssSelect()

int NsCssSelect ( NsCssNode *  n)

◆ NsCssSetViewport()

void NsCssSetViewport ( int  width,
int  height 
)