XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
layout.c File Reference
#include "layout.h"
#include "dom.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <_xeneva.h>
#include <sys/_kefile.h>
Include dependency graph for layout.c:

Classes

struct  NsLayoutBox
 
struct  NsTextPool
 
struct  NsInlineItem
 
struct  NsInlineList
 
struct  NsLineCtx
 
struct  NsFlexItem
 
struct  NsClip
 

Macros

#define NS_BOX_BLOCK   1
 
#define NS_BOX_LINE   2
 
#define NS_BOX_RUN   3
 
#define NS_BOX_CONTROL   4
 
#define NS_BOX_IMAGE   5
 
#define NS_BOX_INLINE_BLOCK   6
 
#define NS_LAYOUT_MAX_LINKS   640
 
#define NS_LAYOUT_MAX_DEPTH   64
 
#define NS_PLAIN_MAX   (256 * 1024)
 
#define NS_LAYOUT_MAX_CONTROLS   128
 

Typedefs

typedef struct NsLayoutBox NsLayoutBox
 
typedef struct NsTextPool NsTextPool
 

Functions

void NsLayoutSetImageLookup (NsImageLookupFn fn)
 
void NsLayoutSetInlineSvgLookup (NsInlineSvgLookupFn fn)
 
int NsLayoutBuild (NsCssNode *root, int viewport_w, int viewport_h)
 
void NsLayoutDestroy (void)
 
int NsLayoutActive (void)
 
int NsLayoutPageHeight (void)
 
int NsLayoutPageWidth (void)
 
int NsLayoutContentHeight (void)
 
void NsLayoutStats (int *blocks, int *lines, int *runs, int *links)
 
uint32_t NsLayoutPageBg (void)
 
void NsLayoutPaint (ChCanvas *canv, int vx, int vy, int vw, int vh, int scroll_y)
 
int NsLayoutHitLink (int x, int y, char *href, size_t hrefsz)
 
int NsLayoutHitControl (int x, int y, NsCssNode **node)
 
void NsLayoutSetEdit (NsCssNode *node, const char *text, int cursor, int active)
 
void NsLayoutDumpBoxes (void)
 
void NsLayoutPrintLinks (int max)
 
int NsLayoutPaintTest (int w, int h, int scroll)
 
int NsLayoutDumpPpm (const char *path, int w, int h, int scroll)
 
const char * NsLayoutText (void)
 

Macro Definition Documentation

◆ NS_BOX_BLOCK

#define NS_BOX_BLOCK   1

Block/inline layout and painting. See layout.h.

Scope: CSS 2.1 block formatting, inline text runs, line wrapping, margins/padding/borders/backgrounds, links, lists, and simple form controls. Tables/floats/positioning degrade to document flow rather than disappearing.

◆ NS_BOX_CONTROL

#define NS_BOX_CONTROL   4

◆ NS_BOX_IMAGE

#define NS_BOX_IMAGE   5

◆ NS_BOX_INLINE_BLOCK

#define NS_BOX_INLINE_BLOCK   6

◆ NS_BOX_LINE

#define NS_BOX_LINE   2

◆ NS_BOX_RUN

#define NS_BOX_RUN   3

◆ NS_LAYOUT_MAX_CONTROLS

#define NS_LAYOUT_MAX_CONTROLS   128

◆ NS_LAYOUT_MAX_DEPTH

#define NS_LAYOUT_MAX_DEPTH   64

◆ NS_LAYOUT_MAX_LINKS

#define NS_LAYOUT_MAX_LINKS   640

◆ NS_PLAIN_MAX

#define NS_PLAIN_MAX   (256 * 1024)

Typedef Documentation

◆ NsLayoutBox

typedef struct NsLayoutBox NsLayoutBox

◆ NsTextPool

typedef struct NsTextPool NsTextPool

Function Documentation

◆ NsLayoutActive()

int NsLayoutActive ( void  )

◆ NsLayoutBuild()

int NsLayoutBuild ( NsCssNode *  root,
int  viewport_w,
int  viewport_h 
)

◆ NsLayoutContentHeight()

int NsLayoutContentHeight ( void  )

◆ NsLayoutDestroy()

void NsLayoutDestroy ( void  )

◆ NsLayoutDumpBoxes()

void NsLayoutDumpBoxes ( void  )

◆ NsLayoutDumpPpm()

int NsLayoutDumpPpm ( const char *  path,
int  w,
int  h,
int  scroll 
)

◆ NsLayoutHitControl()

int NsLayoutHitControl ( int  x,
int  y,
NsCssNode **  node 
)

◆ NsLayoutHitLink()

int NsLayoutHitLink ( int  x,
int  y,
char *  href,
size_t  hrefsz 
)

◆ NsLayoutPageBg()

uint32_t NsLayoutPageBg ( void  )

◆ NsLayoutPageHeight()

int NsLayoutPageHeight ( void  )

◆ NsLayoutPageWidth()

int NsLayoutPageWidth ( void  )

◆ NsLayoutPaint()

void NsLayoutPaint ( ChCanvas *  canv,
int  vx,
int  vy,
int  vw,
int  vh,
int  scroll_y 
)

◆ NsLayoutPaintTest()

int NsLayoutPaintTest ( int  w,
int  h,
int  scroll 
)

◆ NsLayoutPrintLinks()

void NsLayoutPrintLinks ( int  max)

◆ NsLayoutSetEdit()

void NsLayoutSetEdit ( NsCssNode *  node,
const char *  text,
int  cursor,
int  active 
)

◆ NsLayoutSetImageLookup()

void NsLayoutSetImageLookup ( NsImageLookupFn  fn)

◆ NsLayoutSetInlineSvgLookup()

void NsLayoutSetInlineSvgLookup ( NsInlineSvgLookupFn  fn)

◆ NsLayoutStats()

void NsLayoutStats ( int *  blocks,
int *  lines,
int *  runs,
int *  links 
)

◆ NsLayoutText()

const char * NsLayoutText ( void  )

Variable Documentation

◆ h

int h

◆ href

const char* href

◆ node

NsCssNode* node

◆ w

int w

◆ x

int x

◆ y

int y