LsmDomView: Lasem Reference Manual

## LsmDomView LsmDomView — Base class for DOM views |

## Functions

double | lsm_dom_view_get_resolution ()
LsmBox | lsm_dom_view_get_viewport ()
LsmBox | lsm_dom_view_get_viewport_pixels ()
void | lsm_dom_view_set_resolution ()
void | lsm_dom_view_set_viewport ()
void | lsm_dom_view_set_viewport_pixels ()
void | lsm_dom_view_render ()
void | lsm_dom_view_get_size ()
void | lsm_dom_view_get_size_pixels ()
void | lsm_dom_view_set_debug ()

## Types and Values

#define | LSM_DOM_VIEW_DEFAULT_RESOLUTION
#define | LSM_DOM_VIEW_DEFAULT_VIEWBOX_HEIGHT
#define | LSM_DOM_VIEW_DEFAULT_VIEWBOX_WIDTH
| LsmDomView

## Object Hierarchy

        GObject
        ╰── LsmDomView

## Description

## Functions

### lsm_dom_view_get_resolution ()

    double
    lsm_dom_view_get_resolution (LsmDomView *self);

#### Parameters

self | A LsmDomView |

#### Returns

view resolution, in pixel per inch.

### lsm_dom_view_get_viewport ()

    LsmBox
    lsm_dom_view_get_viewport (LsmDomView *self);

#### Parameters

self | a LsmDomView |

#### Returns

viewport size, in points.

### lsm_dom_view_get_viewport_pixels ()

    LsmBox
    lsm_dom_view_get_viewport_pixels (LsmDomView *self);

#### Parameters

self | a LsmDomView |

#### Returns

viewport size, in pixels.

### lsm_dom_view_set_resolution ()

    void
    lsm_dom_view_set_resolution (LsmDomView *self,
                                 double ppi);

Set the view resolution, in pixel per inch.

#### Parameters

self | a LsmDomView |
ppi | resolution, in pixel per inch. |

### lsm_dom_view_set_viewport ()

    void
    lsm_dom_view_set_viewport (LsmDomView *self,
                               const LsmBox *viewport_pt);

Set the viewport size.

#### Parameters

self | a LsmDomView |
viewport_pt | viewport size, in points |

### lsm_dom_view_set_viewport_pixels ()

    void
    lsm_dom_view_set_viewport_pixels (LsmDomView *self,
                                      const LsmBox *viewport);

Set the viewport size.

#### Parameters

self | a LsmDomView |
viewport | viewport size, in pixels |

### lsm_dom_view_render ()

    void
    lsm_dom_view_render (LsmDomView *view,
                         cairo_t *cairo,
                         double x,
                         double y);

Render `view` in the `cairo` context.

#### Parameters

view | a LsmDomView |
cairo | cairo context |
x | x posiiton for rendering |
y | y position for rendering |

### lsm_dom_view_get_size ()

    void
    lsm_dom_view_get_size (LsmDomView *view,
                           double *width,
                           double *height,
                           double *baseline);

Get the view size and baseline. Baseline is for use of view inside bloc of text.

#### Parameters

view | a LsmDomView |
width | view width placeholder, in points |
height | view height placeholder, in points |
baseline | view baseline, in points |

### lsm_dom_view_get_size_pixels ()

    void
    lsm_dom_view_get_size_pixels (LsmDomView *view,
                                  unsigned int *width,
                                  unsigned int *height,
                                  unsigned int *baseline);

Get the view size and baseline. Baseline is for use of view inside bloc of text.

#### Parameters

view | a LsmDomView |
width | view width placeholder, in pixels |
height | view height placeholder, in pixels |
baseline | view baseline, in pixels |

### lsm_dom_view_set_debug ()

    void
    lsm_dom_view_set_debug (LsmDomView *view,
                            const char *feature,
                            gboolean enable);

Configure feature debug.

#### Parameters

view | a LsmDomView |
feature | name of the feature to debug |
enable | wether to enable debugging |

## Types and Values

### LSM_DOM_VIEW_DEFAULT_RESOLUTION

    #define LSM_DOM_VIEW_DEFAULT_RESOLUTION 	 72.0

### LSM_DOM_VIEW_DEFAULT_VIEWBOX_HEIGHT

    #define LSM_DOM_VIEW_DEFAULT_VIEWBOX_HEIGHT 	200.0

### LSM_DOM_VIEW_DEFAULT_VIEWBOX_WIDTH

    #define LSM_DOM_VIEW_DEFAULT_VIEWBOX_WIDTH 320.0

### LsmDomView

    typedef struct _LsmDomView LsmDomView;