[lasem] docs: some more fixes.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [lasem] docs: some more fixes.
- Date: Fri, 28 Sep 2012 17:14:03 +0000 (UTC)
commit 10c4e75d326aa716d9c1c3f9d4206302e4aacd23
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Fri Sep 28 19:13:40 2012 +0200
docs: some more fixes.
docs/reference/lasem/lasem-docs.xml | 6 +-
src/lsmdomdocument.c | 6 +++
src/lsmdomelement.c | 24 ++++++++++
src/lsmdomnamednodemap.c | 5 ++
src/lsmdomnodelist.c | 5 ++
src/lsmdomview.c | 85 ++++++++++++++++++++++++++++++++++-
src/lsmdomview.h | 2 +-
7 files changed, 128 insertions(+), 5 deletions(-)
---
diff --git a/docs/reference/lasem/lasem-docs.xml b/docs/reference/lasem/lasem-docs.xml
index 9a82590..8b57f8e 100644
--- a/docs/reference/lasem/lasem-docs.xml
+++ b/docs/reference/lasem/lasem-docs.xml
@@ -39,14 +39,14 @@
<chapter>
<title>DOM</title>
<xi:include href="xml/lsmdomnode.xml"/>
- <xi:include href="xml/lsmdomnodelist.xml"/>
- <xi:include href="xml/lsmdomnamednodemap.xml"/>
<xi:include href="xml/lsmdomdocument.xml"/>
- <xi:include href="xml/lsmdomdocumentfragment.xml"/>
<xi:include href="xml/lsmdomelement.xml"/>
<xi:include href="xml/lsmdomcharacterdata.xml"/>
<xi:include href="xml/lsmdomtext.xml"/>
<xi:include href="xml/lsmdomview.xml"/>
+ <xi:include href="xml/lsmdomnodelist.xml"/>
+ <xi:include href="xml/lsmdomnamednodemap.xml"/>
+ <xi:include href="xml/lsmdomdocumentfragment.xml"/>
</chapter>
</part>
diff --git a/src/lsmdomdocument.c b/src/lsmdomdocument.c
index 1baf3e5..1b12b10 100644
--- a/src/lsmdomdocument.c
+++ b/src/lsmdomdocument.c
@@ -56,6 +56,7 @@ lsm_dom_document_get_node_type (LsmDomNode *node)
/**
* lsm_dom_document_get_document_element:
* @self: a #LsmDomElement
+ *
* Returns: (transfer none): document element
*/
@@ -71,6 +72,7 @@ lsm_dom_document_get_document_element (LsmDomDocument *self)
* lsm_dom_document_create_element:
* @self: a #LsmDomDocument
* @tag_name: name of the element to create
+ *
* Returns: (transfer full): a newly created #LsmDomElement
*/
@@ -98,6 +100,7 @@ lsm_dom_document_create_text_node_base (LsmDomDocument *document, const char *da
* lsm_dom_document_create_text_node:
* @self: a #LsmDomDocument
* @data: content of the text node
+ *
* Returns: (transfer full): a newly created #LsmDomText
*/
@@ -112,6 +115,7 @@ lsm_dom_document_create_text_node (LsmDomDocument *document, const char *data)
/**
* lsm_dom_document_create_view:
* @self: a #LsmDomDocument
+ *
* Returns: (transfer full): a new #LsmDomView
*/
@@ -127,6 +131,7 @@ lsm_dom_document_create_view (LsmDomDocument *self)
* lsm_dom_document_get_element_by_id:
* @self: a #LsmDomDocument
* @id: id of the element to find
+ *
* Returns: (transfer none): the requested element, NULL if not found.
*/
@@ -204,6 +209,7 @@ lsm_dom_document_set_url (LsmDomDocument *self, const char *url)
* @self: a #LsmDomDocument
* @href: href
* @size: placeholder for the size of the returned data
+ *
* Returns: (transfer full): a newly allocated buffer containing the requested data.
*/
diff --git a/src/lsmdomelement.c b/src/lsmdomelement.c
index bc3be95..0206e5d 100644
--- a/src/lsmdomelement.c
+++ b/src/lsmdomelement.c
@@ -74,6 +74,14 @@ lsm_dom_element_write_to_stream (LsmDomNode *self, GOutputStream *stream, GError
/* LsmDomElement implementation */
+/**
+ * lsm_dom_element_get_attribute:
+ * @self: a #LsmDomElement
+ * @name: attribute name
+ *
+ * Returns: (transfer none): attribute value, as string.
+ */
+
const char *
lsm_dom_element_get_attribute (LsmDomElement* self, const char* name)
{
@@ -83,6 +91,15 @@ lsm_dom_element_get_attribute (LsmDomElement* self, const char* name)
return LSM_DOM_ELEMENT_GET_CLASS (self)->get_attribute (self, name);
}
+/**
+ * lsm_dom_element_set_attribute:
+ * @self: a #LsmDomElement
+ * @name: attribute name
+ * @attribute_value: attribute value as string
+ *
+ * Set the atribute value.
+ */
+
void
lsm_dom_element_set_attribute (LsmDomElement* self, const char* name, const char* attribute_value)
{
@@ -94,6 +111,13 @@ lsm_dom_element_set_attribute (LsmDomElement* self, const char* name, const char
lsm_dom_node_changed (LSM_DOM_NODE (self));
}
+/**
+ * lsm_dom_element_get_tag_name:
+ * @self: a #LsmDomElement
+ *
+ * Returns: (transfer none): element tag name.
+ */
+
const char *
lsm_dom_element_get_tag_name (LsmDomElement *self)
{
diff --git a/src/lsmdomnamednodemap.c b/src/lsmdomnamednodemap.c
index b555cab..6991a36 100644
--- a/src/lsmdomnamednodemap.c
+++ b/src/lsmdomnamednodemap.c
@@ -24,6 +24,11 @@
#include <lsmdomnamednodemap.h>
#include <lsmdomnode.h>
+/**
+ * SECTION:lsmdomnamednodemap
+ * @short_description: Base class for DOM named node maps
+ */
+
/* LsmDomNamedNodeMap implementation */
/**
diff --git a/src/lsmdomnodelist.c b/src/lsmdomnodelist.c
index 19cd2bd..2b40f30 100644
--- a/src/lsmdomnodelist.c
+++ b/src/lsmdomnodelist.c
@@ -24,6 +24,11 @@
#include <lsmdomnodelist.h>
#include <lsmdomnode.h>
+/**
+ * SECTION:lsmdomnodelist
+ * @short_description: Base class for DOM node lists
+ */
+
/* LsmDomNodeList implementation */
/**
diff --git a/src/lsmdomview.c b/src/lsmdomview.c
index 8ab5533..f11bd98 100644
--- a/src/lsmdomview.c
+++ b/src/lsmdomview.c
@@ -1,6 +1,6 @@
/* Lasem
*
- * Copyright  2009 Emmanuel Pacaud
+ * Copyright  2009-2012 Emmanuel Pacaud
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -32,6 +32,13 @@
static GObjectClass *parent_class;
+/**
+ * lsm_dom_view_get_resolution:
+ * @self: A #LsmDomView
+ *
+ * Returns: view resolution, in pixel per inch.
+ */
+
double
lsm_dom_view_get_resolution (LsmDomView *self)
{
@@ -40,6 +47,14 @@ lsm_dom_view_get_resolution (LsmDomView *self)
return self->resolution_ppi;
}
+/**
+ * lsm_dom_view_set_resolution:
+ * @self: a #LsmDomView
+ * @ppi: resolution, in pixel per inch.
+ *
+ * Set the view resolution, in pixel per inch.
+ */
+
void
lsm_dom_view_set_resolution (LsmDomView *self, double ppi)
{
@@ -51,6 +66,14 @@ lsm_dom_view_set_resolution (LsmDomView *self, double ppi)
self->resolution_ppi = ppi;
}
+/**
+ * lsm_dom_view_set_viewport:
+ * @self: a #LsmDomView
+ * @viewport_pt: viewport size, in points
+ *
+ * Set the viewport size.
+ */
+
void
lsm_dom_view_set_viewport (LsmDomView *self, const LsmBox *viewport_pt)
{
@@ -60,6 +83,14 @@ lsm_dom_view_set_viewport (LsmDomView *self, const LsmBox *viewport_pt)
self->viewport_pt = *viewport_pt;
}
+/**
+ * lsm_dom_view_set_viewport_pixels:
+ * @self: a #LsmDomView
+ * @viewport: viewport size, in pixels
+ *
+ * Set the viewport size.
+ */
+
void
lsm_dom_view_set_viewport_pixels (LsmDomView *self, const LsmBox *viewport)
{
@@ -72,6 +103,13 @@ lsm_dom_view_set_viewport_pixels (LsmDomView *self, const LsmBox *viewport)
self->viewport_pt.height = viewport->height * 72.0 / self->resolution_ppi;
}
+/**
+ * lsm_dom_view_get_viewport:
+ * @self: a #LsmDomView
+ *
+ * Returns: viewport size, in points.
+ */
+
LsmBox
lsm_dom_view_get_viewport (LsmDomView *self)
{
@@ -82,6 +120,13 @@ lsm_dom_view_get_viewport (LsmDomView *self)
return self->viewport_pt;
}
+/**
+ * lsm_dom_view_get_viewport_pixels:
+ * @self: a #LsmDomView
+ *
+ * Returns: viewport size, in pixels.
+ */
+
LsmBox
lsm_dom_view_get_viewport_pixels (LsmDomView *self)
{
@@ -97,6 +142,16 @@ lsm_dom_view_get_viewport_pixels (LsmDomView *self)
return viewport;
}
+/**
+ * lsm_dom_view_get_size:
+ * @view: a #LsmDomView
+ * @width: view width placeholder, in points
+ * @height: view height placeholder, in points
+ * @baseline: view baseline, in points
+ *
+ * Get the view size and baseline. Baseline is for use of view inside bloc of text.
+ */
+
void
lsm_dom_view_get_size (LsmDomView *view, double *width, double *height, double *baseline)
{
@@ -117,6 +172,16 @@ lsm_dom_view_get_size (LsmDomView *view, double *width, double *height, double *
view_class->measure (view, width, height, baseline);
}
+/**
+ * lsm_dom_view_get_size_pixels:
+ * @view: a #LsmDomView
+ * @width: view width placeholder, in pixels
+ * @height: view height placeholder, in pixels
+ * @baseline: view baseline, in pixels
+ *
+ * Get the view size and baseline. Baseline is for use of view inside bloc of text.
+ */
+
void
lsm_dom_view_get_size_pixels (LsmDomView *view, unsigned int *width, unsigned int *height, unsigned int *baseline)
{
@@ -196,6 +261,16 @@ lsm_dom_view_set_cairo_context (LsmDomView *view, cairo_t *cairo)
cairo_font_options_destroy (font_options);
}
+/**
+ * lsm_dom_view_render:
+ * @view: a #LsmDomView
+ * @cairo: cairo context
+ * @x: x posiiton for rendering
+ * @y: y position for rendering
+ *
+ * Render @view in the @cairo context.
+ */
+
void
lsm_dom_view_render (LsmDomView *view, cairo_t *cairo, double x, double y)
{
@@ -223,6 +298,14 @@ lsm_dom_view_render (LsmDomView *view, cairo_t *cairo, double x, double y)
lsm_dom_view_set_cairo_context (view, NULL);
}
+/**
+ * lsm_dom_view_set_document:
+ * @view: a #LsmDomView
+ * @document: (transfer full): a #LsmDomDocument
+ *
+ * Change the document attached to @view. The previously attached document is unreferenced.
+ */
+
void
lsm_dom_view_set_document (LsmDomView *view, LsmDomDocument *document)
{
diff --git a/src/lsmdomview.h b/src/lsmdomview.h
index 40ac451..d869f6a 100644
--- a/src/lsmdomview.h
+++ b/src/lsmdomview.h
@@ -73,7 +73,7 @@ GType lsm_dom_view_get_type (void);
double lsm_dom_view_get_resolution (LsmDomView *self);
void lsm_dom_view_set_resolution (LsmDomView *self, double ppi);
-void lsm_dom_view_set_viewport (LsmDomView *self, const LsmBox *viewport);
+void lsm_dom_view_set_viewport (LsmDomView *self, const LsmBox *viewport_pt);
void lsm_dom_view_set_viewport_pixels(LsmDomView *self, const LsmBox *viewport);
LsmBox lsm_dom_view_get_viewport (LsmDomView *self);
LsmBox lsm_dom_view_get_viewport_pixels(LsmDomView *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]