summaryrefslogtreecommitdiff
path: root/src/cr-doc-handler.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-doc-handler.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-doc-handler.c')
-rw-r--r--src/cr-doc-handler.c92
1 files changed, 59 insertions, 33 deletions
diff --git a/src/cr-doc-handler.c b/src/cr-doc-handler.c
index 00357c0..bbb1582 100644
--- a/src/cr-doc-handler.c
+++ b/src/cr-doc-handler.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; indent-tabs-mode: ni; c-basic-offset: 8 -*- */
+/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
* This file is part of The Croco Library
@@ -25,7 +25,8 @@
#include "cr-parser.h"
/**
- *@file
+ *@CRDocHandler:
+ *
*The definition of the CRDocHandler class.
*Contains methods to instantiate, destroy,
*and initialyze instances of #CRDocHandler
@@ -58,20 +59,26 @@ struct _CRDocHandlerPriv {
};
/**
+ * cr_doc_handler_new:
*Constructor of #CRDocHandler.
- *@return the newly built instance of
+ *
+ *Returns the newly built instance of
*#CRDocHandler
+ *
*/
CRDocHandler *
cr_doc_handler_new (void)
{
- CRDocHandler *result = ( CRDocHandler *)g_try_malloc (sizeof (CRDocHandler));
+ CRDocHandler *result = NULL;
+
+ result = g_try_malloc (sizeof (CRDocHandler));
g_return_val_if_fail (result, NULL);
memset (result, 0, sizeof (CRDocHandler));
+ result->ref_count++;
- result->priv = (CRDocHandlerPriv *)g_try_malloc (sizeof (CRDocHandlerPriv));
+ result->priv = g_try_malloc (sizeof (CRDocHandlerPriv));
if (!result->priv) {
cr_utils_trace_info ("Out of memory exception");
g_free (result);
@@ -84,15 +91,17 @@ cr_doc_handler_new (void)
}
/**
- *Returns the private parsing context.
+ * cr_doc_handler_get_ctxt:
+ *@a_this: the current instance of #CRDocHandler.
+ *@a_ctxt: out parameter. The new parsing context.
+ *
+ *Gets the private parsing context associated to the document handler
*The private parsing context is used by libcroco only.
- *@param a_this the current instance of #CRDocHandler.
- *@param a_ctxt out parameter. The new parsing context.
- *@return CR_OK upon successfull completion, an error code otherwise.
- *@return the parsing context, or NULL if an error occured.
+ *
+ *Returns CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
-cr_doc_handler_get_ctxt (CRDocHandler * a_this, gpointer * a_ctxt)
+cr_doc_handler_get_ctxt (CRDocHandler const * a_this, gpointer * a_ctxt)
{
g_return_val_if_fail (a_this && a_this->priv, CR_BAD_PARAM_ERROR);
@@ -102,11 +111,13 @@ cr_doc_handler_get_ctxt (CRDocHandler * a_this, gpointer * a_ctxt)
}
/**
+ * cr_doc_handler_set_ctxt:
+ *@a_this: the current instance of #CRDocHandler
+ *@a_ctxt: a pointer to the parsing context.
+ *
*Sets the private parsing context.
*This is used by libcroco only.
- *@param a_this the current instance of #CRDocHandler
- *@param a_ctxt a pointer to the parsing context.
- *@return CR_OK upon successfull completion, an error code otherwise.
+ *Returns CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
cr_doc_handler_set_ctxt (CRDocHandler * a_this, gpointer a_ctxt)
@@ -117,14 +128,17 @@ cr_doc_handler_set_ctxt (CRDocHandler * a_this, gpointer a_ctxt)
}
/**
- *Returns the private parsing result.
+ * cr_doc_handler_get_result:
+ *@a_this: the current instance of #CRDocHandler
+ *@a_result: out parameter. The returned result.
+ *
+ *Gets the private parsing result.
*The private parsing result is used by libcroco only.
- *@param a_this the current instance of #CRDocHandler
- *@param a_result out parameter. The returned result.
- *@return CR_OK upon successfull completion, an error code otherwise.
+ *
+ *Returns CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
-cr_doc_handler_get_result (CRDocHandler * a_this, gpointer * a_result)
+cr_doc_handler_get_result (CRDocHandler const * a_this, gpointer * a_result)
{
g_return_val_if_fail (a_this && a_this->priv, CR_BAD_PARAM_ERROR);
@@ -134,11 +148,14 @@ cr_doc_handler_get_result (CRDocHandler * a_this, gpointer * a_result)
}
/**
+ * cr_doc_handler_set_result:
+ *@a_this: the current instance of #CRDocHandler
+ *@a_result: the new result.
+ *
*Sets the private parsing context.
*This is used by libcroco only.
- *@param a_this the current instance of #CRDocHandler
- *@param a_result the new result.
- *@return CR_OK upon successfull completion, an error code otherwise.
+ *
+ *Returns CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
cr_doc_handler_set_result (CRDocHandler * a_this, gpointer a_result)
@@ -149,14 +166,16 @@ cr_doc_handler_set_result (CRDocHandler * a_this, gpointer a_result)
}
/**
+ *cr_doc_handler_set_default_sac_handler:
+ *@a_this: a pointer to the current instance of #CRDocHandler.
+ *
*Sets the sac handlers contained in the current
*instance of DocHandler to the default handlers.
*For the time being the default handlers are
*test handlers. This is expected to change in a
*near future, when the libcroco gets a bit debugged.
*
- *@param a_this a pointer to the current instance of #CRDocHandler.
- *@return CR_OK upon successfull completion, an error code otherwise.
+ *Returns CR_OK upon successfull completion, an error code otherwise.
*/
enum CRStatus
cr_doc_handler_set_default_sac_handler (CRDocHandler * a_this)
@@ -184,8 +203,8 @@ cr_doc_handler_set_default_sac_handler (CRDocHandler * a_this)
}
/**
- *Increases the reference count of the doc handler
- *@param a_this the current instance of #CRDocHandler.
+ * cr_doc_handler_ref:
+ *@a_this: the current instance of #CRDocHandler.
*/
void
cr_doc_handler_ref (CRDocHandler * a_this)
@@ -196,10 +215,13 @@ cr_doc_handler_ref (CRDocHandler * a_this)
}
/**
+ * cr_doc_handler_unref:
+ *@a_this: the currrent instance of #CRDocHandler.
+ *
*Decreases the ref count of the current instance of #CRDocHandler.
*If the ref count reaches '0' then, destroys the instance.
- *@param a_this the currrent instance of #CRDocHandler.
- *@return TRUE if the instance as been destroyed, FALSE otherwise.
+ *
+ *Returns TRUE if the instance as been destroyed, FALSE otherwise.
*/
gboolean
cr_doc_handler_unref (CRDocHandler * a_this)
@@ -218,9 +240,11 @@ cr_doc_handler_unref (CRDocHandler * a_this)
}
/**
- *The destructor of the #CRDocHandler class.
- *@param a_this the instance of #CRDocHandler to
+ * cr_doc_handler_destroy:
+ *@a_this: the instance of #CRDocHandler to
*destroy.
+ *
+ *The destructor of the #CRDocHandler class.
*/
void
cr_doc_handler_destroy (CRDocHandler * a_this)
@@ -235,9 +259,11 @@ cr_doc_handler_destroy (CRDocHandler * a_this)
}
/**
+ * cr_doc_handler_associate_a_parser:
*Associates a parser to the current document handler
- *@param a_this the current instance of document handler.
- *@param a_parser the parser to associate.
+ *
+ *@a_this: the current instance of document handler.
+ *@a_parser: the parser to associate.
*/
void
cr_doc_handler_associate_a_parser (CRDocHandler *a_this,
@@ -246,5 +272,5 @@ cr_doc_handler_associate_a_parser (CRDocHandler *a_this,
g_return_if_fail (a_this && PRIVATE (a_this)
&& a_parser) ;
- PRIVATE (a_this)->parser = (CRParser *)a_parser ;
+ PRIVATE (a_this)->parser = a_parser ;
}