summaryrefslogtreecommitdiff
path: root/src/cr-additional-sel.c
diff options
context:
space:
mode:
authorAbhishek Sharma <sharma.abhishek.it@gmail.com>2011-11-06 00:28:22 +0530
committerAbhishek Sharma <sharma.abhishek.it@gmail.com>2011-11-06 00:28:22 +0530
commit511a09dfcc59cbec7f5f2e50d17eb833d2fd6628 (patch)
treea3b8e46c917fc4562f1da479158bfecb9239cb72 /src/cr-additional-sel.c
parent50584f3b30393a9c3bbf0a183c663b459d6fa6c6 (diff)
downloadlibcroco-511a09dfcc59cbec7f5f2e50d17eb833d2fd6628.tar.gz
Revert "Sending recent tested changes from inkscape developers to libcroco upstream"
This reverts commit ac3e66fa2bb416507b5b5cf114c1edaa3455f105.
Diffstat (limited to 'src/cr-additional-sel.c')
-rw-r--r--src/cr-additional-sel.c144
1 files changed, 88 insertions, 56 deletions
diff --git a/src/cr-additional-sel.c b/src/cr-additional-sel.c
index 80a4767..5a37eba 100644
--- a/src/cr-additional-sel.c
+++ b/src/cr-additional-sel.c
@@ -26,15 +26,28 @@
#include "string.h"
/**
- *Default constructor of #CRAdditionalSel.
- *@return the newly build instance of #CRAdditionalSel.
+ * CRAdditionalSel:
+ *
+ * #CRAdditionalSel abstracts an additionnal selector.
+ * An additional selector is the selector part
+ * that comes after the combination of type selectors.
+ * It can be either "a class selector (the .class part),
+ * a pseudo class selector, an attribute selector
+ * or an id selector.
+ */
+
+/**
+ * cr_additional_sel_new:
+ *
+ * Default constructor of #CRAdditionalSel.
+ * Returns the newly build instance of #CRAdditionalSel.
*/
CRAdditionalSel *
cr_additional_sel_new (void)
{
CRAdditionalSel *result = NULL;
- result = (CRAdditionalSel *)g_try_malloc (sizeof (CRAdditionalSel));
+ result = g_try_malloc (sizeof (CRAdditionalSel));
if (result == NULL) {
cr_utils_trace_debug ("Out of memory");
@@ -47,10 +60,12 @@ cr_additional_sel_new (void)
}
/**
- *Constructor of #CRAdditionalSel.
- *@param a_sel_type the type of the newly built instance
- *of #CRAdditionalSel.
- *@return the newly built instance of #CRAdditionalSel.
+ * cr_additional_sel_new_with_type:
+ * @a_sel_type: the type of the newly built instance
+ * of #CRAdditionalSel.
+ *
+ * Constructor of #CRAdditionalSel.
+ * Returns the newly built instance of #CRAdditionalSel.
*/
CRAdditionalSel *
cr_additional_sel_new_with_type (enum AddSelectorType a_sel_type)
@@ -67,12 +82,13 @@ cr_additional_sel_new_with_type (enum AddSelectorType a_sel_type)
}
/**
- *Sets a new class name to a
- *CLASS additional selector.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
- *@param a_class_name the new class name to set.
+ * cr_additional_sel_set_class_name:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ * @a_class_name: the new class name to set.
*
+ * Sets a new class name to a
+ * CLASS additional selector.
*/
void
cr_additional_sel_set_class_name (CRAdditionalSel * a_this,
@@ -88,11 +104,13 @@ cr_additional_sel_set_class_name (CRAdditionalSel * a_this,
}
/**
- *Sets a new id name to an
- *ID additional selector.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
- *@param a_id the new id to set.
+ * cr_additional_sel_set_id_name:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ * @a_id: the new id to set.
+ *
+ * Sets a new id name to an
+ * ID additional selector.
*/
void
cr_additional_sel_set_id_name (CRAdditionalSel * a_this, CRString * a_id)
@@ -107,11 +125,13 @@ cr_additional_sel_set_id_name (CRAdditionalSel * a_this, CRString * a_id)
}
/**
- *Sets a new pseudo to a
- *PSEUDO additional selector.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
- *@param a_pseudo the new pseudo to set.
+ * cr_additional_sel_set_pseudo:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ * @a_pseudo: the new pseudo to set.
+ *
+ * Sets a new pseudo to a
+ * PSEUDO additional selector.
*/
void
cr_additional_sel_set_pseudo (CRAdditionalSel * a_this, CRPseudo * a_pseudo)
@@ -127,11 +147,13 @@ cr_additional_sel_set_pseudo (CRAdditionalSel * a_this, CRPseudo * a_pseudo)
}
/**
- *Sets a new instance of #CRAttrSel to
- *a ATTRIBUTE additional selector.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
- *@param a_sel the new instance of #CRAttrSel to set.
+ * cr_additional_sel_set_attr_sel:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ * @a_sel: the new instance of #CRAttrSel to set.
+ *
+ * Sets a new instance of #CRAttrSel to
+ * a ATTRIBUTE additional selector.
*/
void
cr_additional_sel_set_attr_sel (CRAdditionalSel * a_this, CRAttrSel * a_sel)
@@ -146,12 +168,15 @@ cr_additional_sel_set_attr_sel (CRAdditionalSel * a_this, CRAttrSel * a_sel)
}
/**
- *Appends a new instance of #CRAdditional to the
- *current list of #CRAdditional.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
- *@param a_sel the new instance to #CRAdditional to append.
- *@return the new list of CRAdditionalSel or NULL if an error arises.
+ * cr_additional_sel_append:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ * @a_sel: the new instance to #CRAdditional to append.
+ *
+ * Appends a new instance of #CRAdditional to the
+ * current list of #CRAdditional.
+ *
+ * Returns the new list of CRAdditionalSel or NULL if an error arises.
*/
CRAdditionalSel *
cr_additional_sel_append (CRAdditionalSel * a_this, CRAdditionalSel * a_sel)
@@ -179,12 +204,15 @@ cr_additional_sel_append (CRAdditionalSel * a_this, CRAdditionalSel * a_sel)
}
/**
- *Preppends a new instance of #CRAdditional to the
- *current list of #CRAdditional.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
- *@param a_sel the new instance to #CRAdditional to preappend.
- *@return the new list of CRAdditionalSel or NULL if an error arises.
+ * cr_additional_sel_prepend:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ * @a_sel: the new instance to #CRAdditional to preappend.
+ *
+ * Preppends a new instance of #CRAdditional to the
+ * current list of #CRAdditional.
+ *
+ * Returns the new list of CRAdditionalSel or NULL if an error arises.
*/
CRAdditionalSel *
cr_additional_sel_prepend (CRAdditionalSel * a_this, CRAdditionalSel * a_sel)
@@ -202,11 +230,11 @@ cr_additional_sel_prepend (CRAdditionalSel * a_this, CRAdditionalSel * a_sel)
}
guchar *
-cr_additional_sel_to_string (CRAdditionalSel * a_this)
+cr_additional_sel_to_string (CRAdditionalSel const * a_this)
{
guchar *result = NULL;
GString *str_buf = NULL;
- CRAdditionalSel *cur = NULL;
+ CRAdditionalSel const *cur = NULL;
g_return_val_if_fail (a_this, NULL);
@@ -219,7 +247,7 @@ cr_additional_sel_to_string (CRAdditionalSel * a_this)
guchar *name = NULL;
if (cur->content.class_name) {
- name = (guchar *)g_strndup
+ name = g_strndup
(cur->content.class_name->stryng->str,
cur->content.class_name->stryng->len);
@@ -239,7 +267,7 @@ cr_additional_sel_to_string (CRAdditionalSel * a_this)
guchar *name = NULL;
if (cur->content.class_name) {
- name = (guchar *)g_strndup
+ name = g_strndup
(cur->content.id_name->stryng->str,
cur->content.id_name->stryng->len);
@@ -295,7 +323,7 @@ cr_additional_sel_to_string (CRAdditionalSel * a_this)
}
if (str_buf) {
- result = (guchar *)str_buf->str;
+ result = str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
@@ -304,7 +332,7 @@ cr_additional_sel_to_string (CRAdditionalSel * a_this)
}
guchar *
-cr_additional_sel_one_to_string (CRAdditionalSel *a_this)
+cr_additional_sel_one_to_string (CRAdditionalSel const *a_this)
{
guchar *result = NULL;
GString *str_buf = NULL;
@@ -319,7 +347,7 @@ cr_additional_sel_one_to_string (CRAdditionalSel *a_this)
guchar *name = NULL;
if (a_this->content.class_name) {
- name = (guchar *)g_strndup
+ name = g_strndup
(a_this->content.class_name->stryng->str,
a_this->content.class_name->stryng->len);
@@ -339,7 +367,7 @@ cr_additional_sel_one_to_string (CRAdditionalSel *a_this)
guchar *name = NULL;
if (a_this->content.class_name) {
- name = (guchar *)g_strndup
+ name = g_strndup
(a_this->content.id_name->stryng->str,
a_this->content.id_name->stryng->len);
@@ -394,7 +422,7 @@ cr_additional_sel_one_to_string (CRAdditionalSel *a_this)
}
if (str_buf) {
- result = (guchar *)str_buf->str;
+ result = str_buf->str;
g_string_free (str_buf, FALSE);
str_buf = NULL;
}
@@ -403,13 +431,15 @@ cr_additional_sel_one_to_string (CRAdditionalSel *a_this)
}
/**
- *Dumps the current instance of #CRAdditionalSel to a file
- *@param a_this the "this pointer" of the current instance of
- *#CRAdditionalSel.
- *@param a_fp the destination file.
+ * cr_additional_sel_dump:
+ * @a_this: the "this pointer" of the current instance of
+ * #CRAdditionalSel.
+ * @a_fp: the destination file.
+ *
+ * Dumps the current instance of #CRAdditionalSel to a file
*/
void
-cr_additional_sel_dump (CRAdditionalSel * a_this, FILE * a_fp)
+cr_additional_sel_dump (CRAdditionalSel const * a_this, FILE * a_fp)
{
guchar *tmp_str = NULL;
@@ -426,9 +456,11 @@ cr_additional_sel_dump (CRAdditionalSel * a_this, FILE * a_fp)
}
/**
- *Destroys an instance of #CRAdditional.
- *@param a_this the "this pointer" of the current instance
- *of #CRAdditionalSel .
+ * cr_additional_sel_destroy:
+ * @a_this: the "this pointer" of the current instance
+ * of #CRAdditionalSel .
+ *
+ * Destroys an instance of #CRAdditional.
*/
void
cr_additional_sel_destroy (CRAdditionalSel * a_this)