summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@src.gnome.org>2003-03-26 22:13:49 +0000
committerDodji Seketeli <dodji@src.gnome.org>2003-03-26 22:13:49 +0000
commitdf526da09c8a5faf05101e438b84d5061cb4a091 (patch)
treea8ef48b39c6f59e971da974dbe889b9a883f4803
parent3d28f03c0d574bcd0acf5bb86b241485b3bc7460 (diff)
downloadlibcroco-df526da09c8a5faf05101e438b84d5061cb4a091.tar.gz
started to add some new files ...
more work is to come.
-rw-r--r--csslint/csslint.c4
-rw-r--r--src/Makefile.am1
-rw-r--r--src/cr-enc-handler.h7
-rw-r--r--src/cr-lay-eng.c78
-rw-r--r--src/cr-lay-eng.h52
-rw-r--r--src/cr-parser.c9
-rw-r--r--src/cr-style.c14
7 files changed, 152 insertions, 13 deletions
diff --git a/csslint/csslint.c b/csslint/csslint.c
index 5ab5681..469658f 100644
--- a/csslint/csslint.c
+++ b/csslint/csslint.c
@@ -105,7 +105,7 @@ csslint_parse_cmd_line (int a_argc, char **a_argv,
*@param a_argv the argv variable passed to the main function.
*/
static void
-csslint_showVersion (const char *name)
+csslint_show_version (const char *name)
{
fprintf(stderr, "%s: using libcroco version %s\n", name, VERSION);
fprintf(stderr, " compiled with: ");
@@ -182,7 +182,7 @@ main (int argc, char **argv)
if (options.param_version == TRUE)
{
- csslint_showVersion(argv[0]);
+ csslint_show_version(argv[0]);
return 0;
}
diff --git a/src/Makefile.am b/src/Makefile.am
index 8f20b4b..d61592b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,6 +27,7 @@ libcroco_la_SOURCES= \
cr-sel-eng.c \
cr-style.c \
cr-box.c \
+ cr-lay-eng.c \
*.h
INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/intl `pkg-config --cflags glib-2.0` `pkg-config --cflags libxml-2.0` @LIBXML2_CFLAGS@
diff --git a/src/cr-enc-handler.h b/src/cr-enc-handler.h
index 61a0f77..c9a0c20 100644
--- a/src/cr-enc-handler.h
+++ b/src/cr-enc-handler.h
@@ -52,9 +52,10 @@ typedef struct _CREncHandler CREncHandler ;
guchar *a_out,
gulong *a_out_len) ;
- typedef enum CRStatus (*CREncInputStrLenAsUtf8Func) (guchar *a_in_start,
- guchar *a_in_end,
- gulong *a_in_size);
+ typedef enum CRStatus (*CREncInputStrLenAsUtf8Func)
+ (guchar *a_in_start,
+ guchar *a_in_end,
+ gulong *a_in_size);
typedef enum CRStatus (*CREncUtf8StrLenAsOutputFunc)
(guchar *a_in_start,
diff --git a/src/cr-lay-eng.c b/src/cr-lay-eng.c
new file mode 100644
index 0000000..dc279ab
--- /dev/null
+++ b/src/cr-lay-eng.c
@@ -0,0 +1,78 @@
+/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
+
+/*
+ * This file is part of The Croco Library
+ *
+ * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2.1 of the
+ * GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the
+ * GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#include <string.h>
+#include "cr-lay-eng.h"
+
+#define PRIVATE(a_this) ((a_this)->priv)
+
+struct _CRLayEngPriv
+{
+
+} ;
+
+
+CRLayEng *
+cr_lay_eng_new (void)
+{
+ CRLayEng *result = NULL;
+
+ result = g_try_malloc (sizeof (CRLayEng)) ;
+ if (!result)
+ {
+ cr_utils_trace_info ("Out of memory") ;
+ return NULL ;
+ }
+ memset (result, 0, sizeof (CRLayEng)) ;
+
+ PRIVATE (result) = g_try_malloc (sizeof (CRLayEngPriv)) ;
+ if (!PRIVATE (result))
+ {
+ cr_utils_trace_info ("Out of memory") ;
+ g_free (result) ;
+ result = NULL ;
+ return NULL ;
+ }
+ memset (PRIVATE (result), 0, sizeof (CRLayEngPriv)) ;
+
+ return result ;
+}
+
+
+void
+cr_lay_eng_destroy (CRLayEng *a_this)
+{
+ g_return_if_fail (a_this) ;
+
+ if (PRIVATE (a_this))
+ {
+ g_free (PRIVATE (a_this)) ;
+ PRIVATE (a_this) = NULL ;
+ }
+
+ if (a_this)
+ {
+ g_free (a_this) ;
+ }
+}
diff --git a/src/cr-lay-eng.h b/src/cr-lay-eng.h
new file mode 100644
index 0000000..2a410db
--- /dev/null
+++ b/src/cr-lay-eng.h
@@ -0,0 +1,52 @@
+/* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
+
+/*
+ * This file is part of The Croco Library
+ *
+ * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2.1 of the
+ * GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the
+ * GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ */
+
+#ifndef __CR_LAY_ENG_H__
+#define __CR_LAY_ENG_H__
+
+#include <libxml/tree.h>
+#include "cr-utils.h"
+#include "cr-stylesheet.h"
+
+typedef struct _CRLayEngPriv CRLayEngPriv ;
+
+typedef struct
+{
+ CRLayEngPriv *priv ;
+} CRLayEng ;
+
+
+CRLayEng *
+cr_lay_eng_new (void) ;
+
+
+enum CRStatus
+cr_lay_eng_build_annotate_tree (CRLayEng *a_this,
+ xmlDoc *a_xml_doc,
+ CRStyleSheet *a_sheet) ;
+
+void
+cr_lay_eng_destroy (CRLayEng *a_this) ;
+
+#endif /*__CR_LAYOUT_ENG_H__*/
diff --git a/src/cr-parser.c b/src/cr-parser.c
index deed188..676f742 100644
--- a/src/cr-parser.c
+++ b/src/cr-parser.c
@@ -6,7 +6,8 @@
* Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General Public
+ * modify it under the terms of version 2.1 of the
+ * GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -54,8 +55,10 @@
*
*the name of parsing functions (or methods) contained in this file
*follows the following scheme: cr_parser_parse_<production_name> (...) ;
- *where <production_name> is the name of a production of the css2 language.
- *When a given production is defined by the css2 level grammar *and* by the
+ *where <production_name> is the name
+ *of a production of the css2 language.
+ *When a given production is
+ *defined by the css2 level grammar *and* by the
*css core syntax, there will be two functions to parse that production:
*one will parse the production defined by the css2 level grammar and the
*other will parse the production defined by the css core grammar.
diff --git a/src/cr-style.c b/src/cr-style.c
index 9081f80..8cbd0ec 100644
--- a/src/cr-style.c
+++ b/src/cr-style.c
@@ -6,7 +6,8 @@
* Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General Public
+ * modify it under the terms of version 2.1 of
+ * the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -14,7 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public License
+ * You should have received a copy of the
+ * GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
@@ -710,7 +712,8 @@ set_prop_position_from_value (CRStyle *a_style, CRTerm *a_value)
{"absolute", POSITION_ABSOLUTE},
{"fixed", POSITION_FIXED},
{"inherited", POSITION_INHERIT},
- {NULL, POSITION_STATIC} /*must alwas be the last one*/
+ {NULL, POSITION_STATIC}
+ /*must alwas be the last one*/
} ;
g_return_val_if_fail (a_value, CR_BAD_PARAM_ERROR) ;
@@ -733,7 +736,8 @@ set_prop_position_from_value (CRStyle *a_style, CRTerm *a_value)
a_value->content.str->str,
strlen (position_vals_map[i].name)))
{
- a_style->position = position_vals_map[i].type ;
+ a_style->position =
+ position_vals_map[i].type ;
status = CR_OK ;
}
}
@@ -741,7 +745,7 @@ set_prop_position_from_value (CRStyle *a_style, CRTerm *a_value)
{
if (a_style->parent_style)
{
- a_style->position =
+ a_style->position =
a_style->parent_style->position ;
}
else