[gtkhtml] Coding style and whitespace cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkhtml] Coding style and whitespace cleanups.
- Date: Sat, 11 Sep 2010 18:13:28 +0000 (UTC)
commit c4b4e3f8d4a6e1de9ea217c9d14bc5561dc19de7
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Sep 11 13:28:09 2010 -0400
Coding style and whitespace cleanups.
a11y/table.c | 26 ++--
gtkhtml/gtkhtml-embedded.c | 8 +-
gtkhtml/gtkhtml-properties.c | 8 +-
gtkhtml/gtkhtml.c | 82 +++++-----
gtkhtml/gtkhtmldebug.c | 6 +-
gtkhtml/htmlclueflow.c | 54 ++++----
gtkhtml/htmlcolorset.c | 60 ++++----
gtkhtml/htmlcolorset.h | 4 +-
gtkhtml/htmlengine-edit-cursor.c | 2 +-
gtkhtml/htmlengine-edit-cut-and-paste.c | 12 +-
gtkhtml/htmlengine-edit-table.c | 64 ++++----
gtkhtml/htmlengine-edit-tablecell.c | 68 ++++----
gtkhtml/htmlengine-save.c | 2 +-
gtkhtml/htmlengine.c | 52 ++++----
gtkhtml/htmlfontmanager.c | 20 ++--
gtkhtml/htmlfontmanager.h | 2 +-
gtkhtml/htmlframeset.c | 2 +-
gtkhtml/htmlgdkpainter.c | 2 +-
gtkhtml/htmlpainter.c | 6 +-
gtkhtml/htmlprinter.c | 6 +-
gtkhtml/htmlsearch.c | 2 +-
gtkhtml/htmlsettings.h | 2 +-
gtkhtml/htmlstyle.c | 4 +-
gtkhtml/htmltable.c | 250 +++++++++++++++---------------
gtkhtml/htmltext.c | 90 ++++++------
gtkhtml/htmltextslave.c | 32 ++--
gtkhtml/htmltokenizer.c | 34 ++--
gtkhtml/htmlundo.c | 16 +-
gtkhtml/htmlurl.c | 2 +-
gtkhtml/test-stress.c | 24 ++--
gtkhtml/test-suite.c | 16 +-
gtkhtml/testgtkhtml.c | 4 +-
32 files changed, 481 insertions(+), 481 deletions(-)
---
diff --git a/a11y/table.c b/a11y/table.c
index caaa385..d9debdb 100644
--- a/a11y/table.c
+++ b/a11y/table.c
@@ -196,7 +196,7 @@ html_a11y_table_ref_at (AtkTable *table, gint row, gint column)
g_return_val_if_fail (row < to->totalRows, NULL);
g_return_val_if_fail (column < to->totalCols, NULL);
- cell = to->cells [row][column];
+ cell = to->cells[row][column];
if (cell) {
accessible = html_utils_get_accessible (HTML_OBJECT (cell), ATK_OBJECT (table));
@@ -217,9 +217,9 @@ html_a11y_table_get_index_at (AtkTable *table, gint row, gint column)
g_return_val_if_fail (row < to->totalRows, -1);
g_return_val_if_fail (column < to->totalCols, -1);
- g_return_val_if_fail (to->cells [row][column], -1);
+ g_return_val_if_fail (to->cells[row][column], -1);
- return html_object_get_child_index (HTML_OBJECT (to), HTML_OBJECT (to->cells [row][column]));
+ return html_object_get_child_index (HTML_OBJECT (to), HTML_OBJECT (to->cells[row][column]));
}
static gint
@@ -282,9 +282,9 @@ html_a11y_table_get_column_extent_at (AtkTable *table, gint row, gint column)
g_return_val_if_fail (row < to->totalRows, -1);
g_return_val_if_fail (column < to->totalCols, -1);
- g_return_val_if_fail (to->cells [row][column], -1);
+ g_return_val_if_fail (to->cells[row][column], -1);
- return to->cells [row][column]->cspan;
+ return to->cells[row][column]->cspan;
}
static gint
@@ -297,9 +297,9 @@ html_a11y_table_get_row_extent_at (AtkTable *table, gint row, gint column)
g_return_val_if_fail (row < to->totalRows, -1);
g_return_val_if_fail (column < to->totalCols, -1);
- g_return_val_if_fail (to->cells [row][column], -1);
+ g_return_val_if_fail (to->cells[row][column], -1);
- return to->cells [row][column]->rspan;
+ return to->cells[row][column]->rspan;
}
static AtkObject *
@@ -311,10 +311,10 @@ html_a11y_table_get_column_header (AtkTable *table, gint column)
return NULL;
g_return_val_if_fail (column < to->totalCols, NULL);
- g_return_val_if_fail (to->cells [0][column], NULL);
+ g_return_val_if_fail (to->cells[0][column], NULL);
- return to->cells [0][column]->heading
- ? html_utils_get_accessible (HTML_OBJECT (to->cells [0][column]), ATK_OBJECT (table)) : NULL;
+ return to->cells[0][column]->heading
+ ? html_utils_get_accessible (HTML_OBJECT (to->cells[0][column]), ATK_OBJECT (table)) : NULL;
}
static AtkObject *
@@ -326,10 +326,10 @@ html_a11y_table_get_row_header (AtkTable *table, gint row)
return NULL;
g_return_val_if_fail (row < to->totalRows, NULL);
- g_return_val_if_fail (to->cells [row][0], NULL);
+ g_return_val_if_fail (to->cells[row][0], NULL);
- return to->cells [row][0]->heading
- ? html_utils_get_accessible (HTML_OBJECT (to->cells [row][0]), ATK_OBJECT (table)) : NULL;
+ return to->cells[row][0]->heading
+ ? html_utils_get_accessible (HTML_OBJECT (to->cells[row][0]), ATK_OBJECT (table)) : NULL;
}
/* unsupported calls
diff --git a/gtkhtml/gtkhtml-embedded.c b/gtkhtml/gtkhtml-embedded.c
index f14740b..a95da59 100644
--- a/gtkhtml/gtkhtml-embedded.c
+++ b/gtkhtml/gtkhtml-embedded.c
@@ -45,7 +45,7 @@ enum {
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
GType
gtk_html_embedded_get_type (void)
@@ -171,7 +171,7 @@ gtk_html_embedded_class_init (GtkHTMLEmbeddedClass *class)
parent_class = g_type_class_peek_parent (class);
- signals [CHANGED] =
+ signals[CHANGED] =
g_signal_new ("changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -179,7 +179,7 @@ gtk_html_embedded_class_init (GtkHTMLEmbeddedClass *class)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [DRAW_GDK] =
+ signals[DRAW_GDK] =
g_signal_new ("draw_gdk",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -189,7 +189,7 @@ gtk_html_embedded_class_init (GtkHTMLEmbeddedClass *class)
G_TYPE_POINTER, G_TYPE_POINTER,
G_TYPE_INT, G_TYPE_INT);
- signals [DRAW_PRINT] =
+ signals[DRAW_PRINT] =
g_signal_new ("draw_print",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
diff --git a/gtkhtml/gtkhtml-properties.c b/gtkhtml/gtkhtml-properties.c
index 1d56485..ff9bf95 100644
--- a/gtkhtml/gtkhtml-properties.c
+++ b/gtkhtml/gtkhtml-properties.c
@@ -57,8 +57,8 @@ get_locale_language (void)
if (strlen (lang) >= 2) {
if (lang[2] == '-' || lang[2] == '_') {
/* canonicalise the lang */
- lang [0] = g_ascii_tolower (lang [0]);
- lang [1] = g_ascii_tolower (lang [1]);
+ lang[0] = g_ascii_tolower (lang[0]);
+ lang[1] = g_ascii_tolower (lang[1]);
/* validate the country code */
if (strlen (lang + 3) > 2) {
@@ -66,8 +66,8 @@ get_locale_language (void)
lang[2] = '\0';
} else {
lang[2] = '-';
- lang [3] = g_ascii_toupper (lang [3]);
- lang [4] = g_ascii_toupper (lang [4]);
+ lang[3] = g_ascii_toupper (lang[3]);
+ lang[4] = g_ascii_toupper (lang[4]);
}
} else if (lang[2] != '\0') {
/* invalid language */
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index 17da9dd..4bb7a45 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -173,7 +173,7 @@ static void gtk_html_get_property (GObject *object, guint prop_id, GValue *
static void gtk_html_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
#endif
-static guint signals [LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
static void
gtk_html_update_scrollbars_on_resize (GtkHTML *html,
@@ -346,25 +346,25 @@ gtk_html_update_styles (GtkHTML *html)
if (paragraph_style != html->priv->paragraph_style) {
html->priv->paragraph_style = paragraph_style;
- g_signal_emit (html, signals [CURRENT_PARAGRAPH_STYLE_CHANGED], 0, paragraph_style);
+ g_signal_emit (html, signals[CURRENT_PARAGRAPH_STYLE_CHANGED], 0, paragraph_style);
}
indentation = html_engine_get_current_clueflow_indentation (engine);
if (indentation != html->priv->paragraph_indentation) {
html->priv->paragraph_indentation = indentation;
- g_signal_emit (html, signals [CURRENT_PARAGRAPH_INDENTATION_CHANGED], 0, indentation);
+ g_signal_emit (html, signals[CURRENT_PARAGRAPH_INDENTATION_CHANGED], 0, indentation);
}
alignment = html_alignment_to_paragraph (html_engine_get_current_clueflow_alignment (engine));
if (alignment != html->priv->paragraph_alignment) {
html->priv->paragraph_alignment = alignment;
- g_signal_emit (html, signals [CURRENT_PARAGRAPH_ALIGNMENT_CHANGED], 0, alignment);
+ g_signal_emit (html, signals[CURRENT_PARAGRAPH_ALIGNMENT_CHANGED], 0, alignment);
}
if (html_engine_update_insertion_font_style (engine))
- g_signal_emit (html, signals [INSERTION_FONT_STYLE_CHANGED], 0, engine->insertion_font_style);
+ g_signal_emit (html, signals[INSERTION_FONT_STYLE_CHANGED], 0, engine->insertion_font_style);
if (html_engine_update_insertion_color (engine))
- g_signal_emit (html, signals [INSERTION_COLOR_CHANGED], 0, engine->insertion_color);
+ g_signal_emit (html, signals[INSERTION_COLOR_CHANGED], 0, engine->insertion_color);
/* TODO add insertion_url_or_targed_changed signal */
html_engine_update_insertion_url_and_target (engine);
@@ -448,7 +448,7 @@ html_engine_title_changed_cb (HTMLEngine *engine, gpointer data)
GtkHTML *gtk_html;
gtk_html = GTK_HTML (data);
- g_signal_emit (gtk_html, signals [TITLE_CHANGED], 0, engine->title->str);
+ g_signal_emit (gtk_html, signals[TITLE_CHANGED], 0, engine->title->str);
}
static void
@@ -1095,7 +1095,7 @@ key_press_event (GtkWidget *widget, GdkEventKey *event)
/* printf ("link clicked: %s\n", url); */
if (HTML_IS_TEXT(focus_object)) {
html_text_set_link_visited (HTML_TEXT (focus_object), focus_object_offset, html->engine, TRUE);
- g_signal_emit (html, signals [LINK_CLICKED], 0, url);
+ g_signal_emit (html, signals[LINK_CLICKED], 0, url);
}
g_free (url);
}
@@ -2478,7 +2478,7 @@ focus (GtkWidget *w, GtkDirectionType direction)
gtk_widget_grab_focus (w);
update_primary_selection (GTK_HTML (w));
- g_signal_emit (GTK_HTML (w), signals [CURSOR_CHANGED], 0);
+ g_signal_emit (GTK_HTML (w), signals[CURSOR_CHANGED], 0);
return TRUE;
}
@@ -2546,7 +2546,7 @@ focus (GtkWidget *w, GtkDirectionType direction)
}
update_primary_selection (GTK_HTML (w));
- g_signal_emit (GTK_HTML (w), signals [CURSOR_CHANGED], 0);
+ g_signal_emit (GTK_HTML (w), signals[CURSOR_CHANGED], 0);
return TRUE;
}
@@ -2899,7 +2899,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
parent_class = g_type_class_peek_parent (klass);
- signals [TITLE_CHANGED] =
+ signals[TITLE_CHANGED] =
g_signal_new ("title_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2908,7 +2908,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [URL_REQUESTED] =
+ signals[URL_REQUESTED] =
g_signal_new ("url_requested",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -2918,7 +2918,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 2,
G_TYPE_STRING,
G_TYPE_POINTER);
- signals [LOAD_DONE] =
+ signals[LOAD_DONE] =
g_signal_new ("load_done",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2926,7 +2926,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [LINK_CLICKED] =
+ signals[LINK_CLICKED] =
g_signal_new ("link_clicked",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2935,7 +2935,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [SET_BASE] =
+ signals[SET_BASE] =
g_signal_new ("set_base",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2944,7 +2944,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [SET_BASE_TARGET] =
+ signals[SET_BASE_TARGET] =
g_signal_new ("set_base_target",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2954,7 +2954,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [ON_URL] =
+ signals[ON_URL] =
g_signal_new ("on_url",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2964,7 +2964,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [REDIRECT] =
+ signals[REDIRECT] =
g_signal_new ("redirect",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2975,7 +2975,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_STRING,
G_TYPE_INT);
- signals [SUBMIT] =
+ signals[SUBMIT] =
g_signal_new ("submit",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -2987,7 +2987,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_STRING,
G_TYPE_STRING);
- signals [OBJECT_REQUESTED] =
+ signals[OBJECT_REQUESTED] =
g_signal_new ("object_requested",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -2997,7 +2997,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_BOOLEAN, 1,
G_TYPE_OBJECT);
- signals [CURRENT_PARAGRAPH_STYLE_CHANGED] =
+ signals[CURRENT_PARAGRAPH_STYLE_CHANGED] =
g_signal_new ("current_paragraph_style_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3007,7 +3007,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_INT);
- signals [CURRENT_PARAGRAPH_INDENTATION_CHANGED] =
+ signals[CURRENT_PARAGRAPH_INDENTATION_CHANGED] =
g_signal_new ("current_paragraph_indentation_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3017,7 +3017,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_INT);
- signals [CURRENT_PARAGRAPH_ALIGNMENT_CHANGED] =
+ signals[CURRENT_PARAGRAPH_ALIGNMENT_CHANGED] =
g_signal_new ("current_paragraph_alignment_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3027,7 +3027,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_INT);
- signals [INSERTION_FONT_STYLE_CHANGED] =
+ signals[INSERTION_FONT_STYLE_CHANGED] =
g_signal_new ("insertion_font_style_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3037,7 +3037,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_INT);
- signals [INSERTION_COLOR_CHANGED] =
+ signals[INSERTION_COLOR_CHANGED] =
g_signal_new ("insertion_color_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3047,7 +3047,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
G_TYPE_POINTER);
- signals [SIZE_CHANGED] =
+ signals[SIZE_CHANGED] =
g_signal_new ("size_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3055,7 +3055,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [IFRAME_CREATED] =
+ signals[IFRAME_CREATED] =
g_signal_new ("iframe_created",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3065,7 +3065,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 1,
GTK_TYPE_HTML);
- signals [SCROLL] =
+ signals[SCROLL] =
g_signal_new ("scroll",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -3076,7 +3076,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
GTK_TYPE_ORIENTATION,
GTK_TYPE_SCROLL_TYPE, G_TYPE_FLOAT);
- signals [CURSOR_MOVE] =
+ signals[CURSOR_MOVE] =
g_signal_new ("cursor_move",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -3085,7 +3085,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
html_g_cclosure_marshal_VOID__ENUM_ENUM,
G_TYPE_NONE, 2, GTK_TYPE_DIRECTION_TYPE, GTK_TYPE_HTML_CURSOR_SKIP);
- signals [COMMAND] =
+ signals[COMMAND] =
g_signal_new ("command",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
@@ -3094,7 +3094,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
html_g_cclosure_marshal_BOOL__ENUM,
G_TYPE_BOOLEAN, 1, GTK_TYPE_HTML_COMMAND);
- signals [CURSOR_CHANGED] =
+ signals[CURSOR_CHANGED] =
g_signal_new ("cursor_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3103,7 +3103,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [OBJECT_INSERTED] =
+ signals[OBJECT_INSERTED] =
g_signal_new ("object_inserted",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3113,7 +3113,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
G_TYPE_NONE, 2,
G_TYPE_INT, G_TYPE_INT);
- signals [OBJECT_DELETE] =
+ signals[OBJECT_DELETE] =
g_signal_new ("object_delete",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -3986,7 +3986,7 @@ gtk_html_private_calc_scrollbars (GtkHTML *html, gboolean *changed_x, gboolean *
gtk_layout_get_size (layout, &layout_width, &layout_height);
if ((width != layout_width) || (height != layout_height)) {
- g_signal_emit (html, signals [SIZE_CHANGED], 0);
+ g_signal_emit (html, signals[SIZE_CHANGED], 0);
gtk_layout_set_size (layout, width, height);
}
@@ -4380,7 +4380,7 @@ gtk_html_set_font_style (GtkHTML *html,
g_return_if_fail (GTK_IS_HTML (html));
if (html_engine_set_font_style (html->engine, and_mask, or_mask))
- g_signal_emit (html, signals [INSERTION_FONT_STYLE_CHANGED], 0, html->engine->insertion_font_style);
+ g_signal_emit (html, signals[INSERTION_FONT_STYLE_CHANGED], 0, html->engine->insertion_font_style);
}
void
@@ -4390,7 +4390,7 @@ gtk_html_set_color (GtkHTML *html, HTMLColor *color)
g_return_if_fail (GTK_IS_HTML (html));
if (html_engine_set_color (html->engine, color))
- g_signal_emit (html, signals [INSERTION_COLOR_CHANGED], 0, html->engine->insertion_color);
+ g_signal_emit (html, signals[INSERTION_COLOR_CHANGED], 0, html->engine->insertion_color);
}
void
@@ -4404,7 +4404,7 @@ gtk_html_toggle_font_style (GtkHTML *html,
return;
if (html_engine_toggle_font_style (html->engine, style))
- g_signal_emit (html, signals [INSERTION_FONT_STYLE_CHANGED], 0, html->engine->insertion_font_style);
+ g_signal_emit (html, signals[INSERTION_FONT_STYLE_CHANGED], 0, html->engine->insertion_font_style);
}
GtkHTMLParagraphAlignment
@@ -4431,7 +4431,7 @@ gtk_html_set_paragraph_alignment (GtkHTML *html,
if (html_engine_set_clueflow_style (html->engine, 0, 0, align, 0, NULL,
HTML_ENGINE_SET_CLUEFLOW_ALIGNMENT, HTML_UNDO_UNDO, TRUE)) {
html->priv->paragraph_alignment = alignment;
- g_signal_emit (html, signals [CURRENT_PARAGRAPH_ALIGNMENT_CHANGED], 0, alignment);
+ g_signal_emit (html, signals[CURRENT_PARAGRAPH_ALIGNMENT_CHANGED], 0, alignment);
}
}
@@ -4919,7 +4919,7 @@ cursor_move (GtkHTML *html, GtkDirectionType dir_type, GtkHTMLCursorSkipType ski
if (skip == GTK_HTML_CURSOR_SKIP_NONE) {
update_primary_selection (html);
- g_signal_emit (GTK_HTML (html), signals [CURSOR_CHANGED], 0);
+ g_signal_emit (GTK_HTML (html), signals[CURSOR_CHANGED], 0);
return;
}
@@ -5017,7 +5017,7 @@ cursor_move (GtkHTML *html, GtkDirectionType dir_type, GtkHTMLCursorSkipType ski
gtk_html_edit_make_cursor_visible (html);
html_engine_update_selection_active_state (html->engine, html->priv->event_time);
update_primary_selection (html);
- g_signal_emit (GTK_HTML (html), signals [CURSOR_CHANGED], 0);
+ g_signal_emit (GTK_HTML (html), signals[CURSOR_CHANGED], 0);
}
static gboolean
@@ -5893,7 +5893,7 @@ gtk_html_set_iframe_parent (GtkHTML *html, GtkWidget *parent, HTMLObject *frame)
html_painter_set_widget (html->engine->painter, top_level);
gtk_html_set_fonts (html, html->engine->painter);
}
- g_signal_emit (top_level, signals [IFRAME_CREATED], 0, html);
+ g_signal_emit (top_level, signals[IFRAME_CREATED], 0, html);
while (html->iframe_parent) {
depth++;
diff --git a/gtkhtml/gtkhtmldebug.c b/gtkhtml/gtkhtmldebug.c
index abb0446..2e9d9ab 100644
--- a/gtkhtml/gtkhtmldebug.c
+++ b/gtkhtml/gtkhtmldebug.c
@@ -206,7 +206,7 @@ gtk_html_debug_dump_object (HTMLObject *obj,
tw = 0;
offset = 0;
while (offset < HTML_TEXT_SLAVE (obj)->posLen) {
- tw += HTML_TEXT_SLAVE (obj)->owner->pi->entries [ii].widths [io];
+ tw += HTML_TEXT_SLAVE (obj)->owner->pi->entries[ii].widths[io];
g_print ("%d ", HTML_TEXT_SLAVE (obj)->owner->pi->entries [ii].widths [io]);
html_text_pi_forward (HTML_TEXT_SLAVE (obj)->owner->pi, &ii, &io);
offset++;
@@ -238,7 +238,7 @@ gtk_html_debug_dump_object (HTMLObject *obj,
PangoLogAttr attr;
guint as_int;
} u;
- u.attr = text->pi->attrs [i];
+ u.attr = text->pi->attrs[i];
g_print ("log attrs[%d]: %d\n\t", i, u.as_int & 0x7ff);
if (u.attr.is_line_break)
g_print ("line break, ");
@@ -344,7 +344,7 @@ dump_object_simple (HTMLObject *obj,
gchar *text;
text = alloca (slave->posLen+1);
- text [slave->posLen] = 0;
+ text[slave->posLen] = 0;
strncpy (text, slave->owner->text + slave->posStart, slave->posLen);
g_print ("%s `%s'\n",
html_type_name (HTML_OBJECT_TYPE (obj)),
diff --git a/gtkhtml/htmlclueflow.c b/gtkhtml/htmlclueflow.c
index 9e82f99..26e589b 100644
--- a/gtkhtml/htmlclueflow.c
+++ b/gtkhtml/htmlclueflow.c
@@ -463,7 +463,7 @@ need_blockquote_padding (HTMLClueFlow *flow, HTMLClueFlow *prev)
while (i > 0) {
HTMLListType type;
- type = prev->levels->data [prev->levels->len - i];
+ type = prev->levels->data[prev->levels->len - i];
if (is_blockquote (type)) {
return TRUE;
@@ -1143,19 +1143,19 @@ get_roman_value (gint value, gboolean lower)
if (r != 0) {
if (r < 4) {
for (; r; r--)
- g_string_prepend_c (str, base [b] + add);
+ g_string_prepend_c (str, base[b] + add);
} else if (r == 4) {
- g_string_prepend_c (str, base [b + 1] + add);
- g_string_prepend_c (str, base [b] + add);
+ g_string_prepend_c (str, base[b + 1] + add);
+ g_string_prepend_c (str, base[b] + add);
} else if (r == 5) {
- g_string_prepend_c (str, base [b + 1] + add);
+ g_string_prepend_c (str, base[b + 1] + add);
} else if (r < 9) {
for (; r > 5; r--)
- g_string_prepend_c (str, base [b] + add);
- g_string_prepend_c (str, base [b + 1] + add);
+ g_string_prepend_c (str, base[b] + add);
+ g_string_prepend_c (str, base[b + 1] + add);
} else if (r == 9) {
- g_string_prepend_c (str, base [b + 2] + add);
- g_string_prepend_c (str, base [b] + add);
+ g_string_prepend_c (str, base[b + 2] + add);
+ g_string_prepend_c (str, base[b] + add);
}
}
}
@@ -1175,8 +1175,8 @@ get_item_marker_str (HTMLClueFlow *flow, gboolean ascii_only)
gint i;
for (i = flow->levels->len - 1; i >= 0; i--) {
- if (flow->levels->data [i] != HTML_LIST_TYPE_BLOCKQUOTE) {
- type = flow->levels->data [i];
+ if (flow->levels->data[i] != HTML_LIST_TYPE_BLOCKQUOTE) {
+ type = flow->levels->data[i];
break;
}
}
@@ -2019,7 +2019,7 @@ save_plain (HTMLObject *self,
n_items = g_list_length (items_list);
items = g_new (PangoItem *, n_items);
for (i = 0, cur = items_list; i < n_items; i++, cur = cur->next)
- items [i] = (PangoItem *) cur->data;
+ items[i] = (PangoItem *) cur->data;
offset = 0;
for (i = 0; i < n_items; i++) {
@@ -2027,13 +2027,13 @@ save_plain (HTMLObject *self,
gint start_offset;
start_offset = offset;
- offset += items [i]->num_chars;
- tmp_item = *items [i];
+ offset += items[i]->num_chars;
+ tmp_item = *items[i];
while (i < n_items - 1) {
- if (tmp_item.analysis.lang_engine == items [i + 1]->analysis.lang_engine) {
- tmp_item.length += items [i + 1]->length;
- tmp_item.num_chars += items [i + 1]->num_chars;
- offset += items [i + 1]->num_chars;
+ if (tmp_item.analysis.lang_engine == items[i + 1]->analysis.lang_engine) {
+ tmp_item.length += items[i + 1]->length;
+ tmp_item.num_chars += items[i + 1]->num_chars;
+ offset += items[i + 1]->num_chars;
i++;
} else
break;
@@ -2046,7 +2046,7 @@ save_plain (HTMLObject *self,
g_list_free (items_list);
for (i = 0; i < n_items; i++)
- pango_item_free (items [i]);
+ pango_item_free (items[i]);
g_free (items);
pango_attr_list_unref (attrs);
@@ -2067,12 +2067,12 @@ save_plain (HTMLObject *self,
wmax = clen + utf8_length_in_width ((gchar *) s, len, max_width);
wl = wmax;
- if (lattrs [wl].is_white) {
+ if (lattrs[wl].is_white) {
- while (lattrs [wl].is_white && wl < slen)
+ while (lattrs[wl].is_white && wl < slen)
wl++;
- if (wl < slen && html_text_is_line_break (lattrs [wl]))
+ if (wl < slen && html_text_is_line_break (lattrs[wl]))
look_backward = FALSE;
else
wl = wmax;
@@ -2080,15 +2080,15 @@ save_plain (HTMLObject *self,
if (look_backward) {
while (wl > 0) {
- if (html_text_is_line_break (lattrs [wl]))
+ if (html_text_is_line_break (lattrs[wl]))
break;
wl--;
}
}
- if (wl > clen && wl < slen && html_text_is_line_break (lattrs [wl])) {
+ if (wl > clen && wl < slen && html_text_is_line_break (lattrs[wl])) {
wi = MIN (wl, wmax);
- while (wi > clen && lattrs [wi - 1].is_white)
+ while (wi > clen && lattrs[wi - 1].is_white)
wi--;
len = wi - clen;
width = utf8_width ((gchar *) s, len);
@@ -2262,7 +2262,7 @@ search_text (HTMLObject **beg, HTMLSearch *info)
if (text_bytes > 0) {
par = (guchar *) g_new (gchar, text_bytes + 1);
- par [text_bytes] = 0;
+ par[text_bytes] = 0;
pp = (info->forward) ? par : par + text_bytes;
@@ -2943,7 +2943,7 @@ get_text (HTMLClue *clue, HTMLInterval *i)
bytes = get_text_bytes (clue, i);
ct = text = g_malloc (bytes + 1);
- text [bytes] = 0;
+ text[bytes] = 0;
obj = html_interval_get_head (i, HTML_OBJECT (clue));
while (obj) {
diff --git a/gtkhtml/htmlcolorset.c b/gtkhtml/htmlcolorset.c
index da8cbf0..ec904f0 100644
--- a/gtkhtml/htmlcolorset.c
+++ b/gtkhtml/htmlcolorset.c
@@ -38,17 +38,17 @@ html_colorset_new (GtkWidget *w)
if (w && gtk_widget_get_style (w)) {
html_colorset_set_style (s, w);
} else {
- s->color [HTMLLinkColor] = html_color_new_from_rgb (0, 0, 0xffff);
- s->color [HTMLALinkColor] = html_color_new_from_rgb (0, 0, 0xffff);
- s->color [HTMLVLinkColor] = html_color_new_from_rgb (0xffff, 0, 0);
- s->color [HTMLSpellErrorColor] = html_color_new_from_rgb (0xffff, 0, 0);
- s->color [HTMLBgColor] = html_color_new_from_rgb (0xffff, 0xffff, 0xffff);
- s->color [HTMLHighlightColor] = html_color_new_from_rgb (0x7fff, 0x7fff, 0xffff);
- s->color [HTMLHighlightTextColor] = html_color_new ();
- s->color [HTMLHighlightNFColor] = html_color_new ();
- s->color [HTMLHighlightTextNFColor] = html_color_new ();
- s->color [HTMLTextColor] = html_color_new ();
- s->color [HTMLCiteColor] = html_color_new ();
+ s->color[HTMLLinkColor] = html_color_new_from_rgb (0, 0, 0xffff);
+ s->color[HTMLALinkColor] = html_color_new_from_rgb (0, 0, 0xffff);
+ s->color[HTMLVLinkColor] = html_color_new_from_rgb (0xffff, 0, 0);
+ s->color[HTMLSpellErrorColor] = html_color_new_from_rgb (0xffff, 0, 0);
+ s->color[HTMLBgColor] = html_color_new_from_rgb (0xffff, 0xffff, 0xffff);
+ s->color[HTMLHighlightColor] = html_color_new_from_rgb (0x7fff, 0x7fff, 0xffff);
+ s->color[HTMLHighlightTextColor] = html_color_new ();
+ s->color[HTMLHighlightNFColor] = html_color_new ();
+ s->color[HTMLHighlightTextNFColor] = html_color_new ();
+ s->color[HTMLTextColor] = html_color_new ();
+ s->color[HTMLCiteColor] = html_color_new ();
}
return s;
@@ -84,8 +84,8 @@ html_colorset_set_color (HTMLColorSet *s, GdkColor *color, HTMLColorId idx)
GSList *cur;
HTMLColorSet *cs;
- html_color_set (s->color [idx], color);
- s->changed [idx] = TRUE;
+ html_color_set (s->color[idx], color);
+ s->changed[idx] = TRUE;
/* forward change to slaves */
cur = s->slaves;
@@ -99,14 +99,14 @@ html_colorset_set_color (HTMLColorSet *s, GdkColor *color, HTMLColorId idx)
HTMLColor *
html_colorset_get_color (HTMLColorSet *s, HTMLColorId idx)
{
- return s->color [idx];
+ return s->color[idx];
}
HTMLColor *
html_colorset_get_color_allocated (HTMLColorSet *s, HTMLPainter *painter, HTMLColorId idx)
{
- html_color_alloc (s->color [idx], painter);
- return s->color [idx];
+ html_color_alloc (s->color[idx], painter);
+ return s->color[idx];
}
void
@@ -115,9 +115,9 @@ html_colorset_set_by (HTMLColorSet *s, HTMLColorSet *o)
HTMLColorId i;
for (i=0; i < HTMLColors; i++) {
- html_colorset_set_color (s, &o->color [i]->color, i);
+ html_colorset_set_color (s, &o->color[i]->color, i);
/* unset the changed flag */
- s->changed [i] = FALSE;
+ s->changed[i] = FALSE;
}
}
@@ -128,8 +128,8 @@ html_colorset_set_unchanged (HTMLColorSet *s, HTMLColorSet *o)
for (i=0; i < HTMLColors; i++) {
if (!s->changed[i]) {
- html_colorset_set_color (s, &o->color [i]->color, i);
- s->changed [i] = FALSE;
+ html_colorset_set_color (s, &o->color[i]->color, i);
+ s->changed[i] = FALSE;
}
}
}
@@ -157,13 +157,13 @@ get_prop_color (GtkWidget *w,
return gdk_color_copy (gdk_color);
g_warning ("falling back to text color");
- return (gdk_color_copy (&style->text [GTK_STATE_NORMAL]));
+ return (gdk_color_copy (&style->text[GTK_STATE_NORMAL]));
}
#define SET_GCOLOR(t,c) \
- if (!s->changed [HTML ## t ## Color]) { \
- if (s->color [HTML ## t ## Color]) html_color_unref (s->color [HTML ## t ## Color]); \
- s->color [HTML ## t ## Color] = html_color_new_from_gdk_color (&c); \
+ if (!s->changed[HTML ## t ## Color]) { \
+ if (s->color[HTML ## t ## Color]) html_color_unref (s->color[HTML ## t ## Color]); \
+ s->color[HTML ## t ## Color] = html_color_new_from_gdk_color (&c); \
}
void
@@ -172,12 +172,12 @@ html_colorset_set_style (HTMLColorSet *s, GtkWidget *w)
GdkColor *color = NULL;
GtkStyle *style = gtk_widget_get_style (w);
- SET_GCOLOR (Bg, style->base [GTK_STATE_NORMAL]);
- SET_GCOLOR (Text, style->text [GTK_STATE_NORMAL]);
- SET_GCOLOR (Highlight, style->base [GTK_STATE_SELECTED]);
- SET_GCOLOR (HighlightText, style->text [GTK_STATE_SELECTED]);
- SET_GCOLOR (HighlightNF, style->base [GTK_STATE_ACTIVE]);
- SET_GCOLOR (HighlightTextNF, style->text [GTK_STATE_ACTIVE]);
+ SET_GCOLOR (Bg, style->base[GTK_STATE_NORMAL]);
+ SET_GCOLOR (Text, style->text[GTK_STATE_NORMAL]);
+ SET_GCOLOR (Highlight, style->base[GTK_STATE_SELECTED]);
+ SET_GCOLOR (HighlightText, style->text[GTK_STATE_SELECTED]);
+ SET_GCOLOR (HighlightNF, style->base[GTK_STATE_ACTIVE]);
+ SET_GCOLOR (HighlightTextNF, style->text[GTK_STATE_ACTIVE]);
color = get_prop_color (w, "link_color", "#0000ff", NULL);
SET_GCOLOR (Link, *color);
gdk_color_free (color);
diff --git a/gtkhtml/htmlcolorset.h b/gtkhtml/htmlcolorset.h
index 73c829a..fd25886 100644
--- a/gtkhtml/htmlcolorset.h
+++ b/gtkhtml/htmlcolorset.h
@@ -28,8 +28,8 @@
struct _HTMLColorSet
{
- HTMLColor *color [HTMLColors];
- gboolean changed [HTMLColors];
+ HTMLColor *color[HTMLColors];
+ gboolean changed[HTMLColors];
/* slave sets - they must be updated when setting this one
engine has master set and painters have slave ones
diff --git a/gtkhtml/htmlengine-edit-cursor.c b/gtkhtml/htmlengine-edit-cursor.c
index ce59c06..3f89f2a 100644
--- a/gtkhtml/htmlengine-edit-cursor.c
+++ b/gtkhtml/htmlengine-edit-cursor.c
@@ -121,7 +121,7 @@ draw_cursor_rectangle (HTMLEngine *e, gint x1, gint y1, gint x2, gint y2,
{
GdkGC *gc;
GdkColor color;
- gint8 dashes [2] = { 1, 3 };
+ gint8 dashes[2] = { 1, 3 };
if (x1 > x2 || y1 > y2 || !e->window)
return;
diff --git a/gtkhtml/htmlengine-edit-cut-and-paste.c b/gtkhtml/htmlengine-edit-cut-and-paste.c
index d65b31e..ee23ee9 100644
--- a/gtkhtml/htmlengine-edit-cut-and-paste.c
+++ b/gtkhtml/htmlengine-edit-cut-and-paste.c
@@ -1176,7 +1176,7 @@ check_magic_link (HTMLEngine *e, const gchar *text, guint len)
if (HTML_IS_TEXT (e->cursor->object)
&& gtk_html_get_magic_links (e->widget)
&& len == 1
- && (*text == ' ' || text [0] == '\n' || text [0] == '>' || text [0] == ')'))
+ && (*text == ' ' || text[0] == '\n' || text[0] == '>' || text[0] == ')'))
html_text_magic_link (HTML_TEXT (e->cursor->object), e, 1);
}
@@ -1277,7 +1277,7 @@ static const gchar *picto_chars =
/* 50 */ "\0:\0:-\0:\0:-"
/* 60 */ "\0:\0:\0:-\0:\0"
/* 70 */ ":-\0:\0:-\0:\0";
-static gint picto_states [] = {
+static gint picto_states[] = {
/* 0 */ 12, 17, 22, 34, 43, 48, 53, 58, 65, 70,
/* 10 */ 75, 0, -15, 15, 0, -15, 0, -17, 20, 0,
/* 20 */ -17, 0, -14, -20, -14, 28, 63, 0, -14, -20,
@@ -1286,7 +1286,7 @@ static gint picto_states [] = {
/* 50 */ 0, -19, 0, -11, 56, 0, -11, 0, -13, 61,
/* 60 */ 0, -13, 0, -6, 0, 68, -7, 0, -7, 0,
/* 70 */ -16, 73, 0, -16, 0, -21, 78, 0, -21, 0 };
-static const gchar *picto_icon_names [] = {
+static const gchar *picto_icon_names[] = {
"face-angel",
"face-angry",
"face-cool",
@@ -1326,12 +1326,12 @@ use_pictograms (HTMLEngine *e)
while (pos >= 0) {
uc = html_text_get_char (HTML_TEXT (e->cursor->object), pos);
relative = 0;
- while (picto_chars [state + relative]) {
- if (picto_chars [state + relative] == uc)
+ while (picto_chars[state + relative]) {
+ if (picto_chars[state + relative] == uc)
break;
relative++;
}
- state = picto_states [state + relative];
+ state = picto_states[state + relative];
/* 0 .. not found, -n .. found n-th */
if (state <= 0)
break;
diff --git a/gtkhtml/htmlengine-edit-table.c b/gtkhtml/htmlengine-edit-table.c
index 3610761..ac957b0 100644
--- a/gtkhtml/htmlengine-edit-table.c
+++ b/gtkhtml/htmlengine-edit-table.c
@@ -90,7 +90,7 @@ html_engine_insert_table_1_1 (HTMLEngine *e)
html_engine_append_object (e, table, 2);
html_cursor_backward (e->cursor, e);
- html_engine_table_set_align (e, table, HTML_HALIGN_CENTER);
+ html_engine_table_set_align (e, (HTMLTable *) table, HTML_HALIGN_CENTER);
}
/**
@@ -241,30 +241,30 @@ html_table_insert_column (HTMLTable *t, HTMLEngine *e, gint col, HTMLTableCell *
html_table_alloc_cell (t, 0, t->totalCols);
for (c = t->totalCols - 1; c > col; c--) {
for (r = 0; r < t->totalRows; r++) {
- HTMLTableCell *cell = t->cells [r][c - 1];
+ HTMLTableCell *cell = t->cells[r][c - 1];
if (cell) {
if (cell->col == c - 1) {
html_table_cell_set_position (cell, cell->row, c);
- t->cells [r][c - 1] = NULL;
+ t->cells[r][c - 1] = NULL;
} else if (c == col + 1 && cell->row == r)
cell->cspan++;
if (cell->col > c - 1)
- t->cells [r][c - 1] = NULL;
- t->cells [r][c] = cell;
+ t->cells[r][c - 1] = NULL;
+ t->cells[r][c] = cell;
}
}
}
for (r = 0; r < t->totalRows; r++) {
- if (!t->cells [r][col]) {
+ if (!t->cells[r][col]) {
guint len;
cell = column
- ? HTML_TABLE_CELL (html_object_op_copy (HTML_OBJECT (column [r]), HTML_OBJECT (t),
+ ? HTML_TABLE_CELL (html_object_op_copy (HTML_OBJECT (column[r]), HTML_OBJECT (t),
e, NULL, NULL, &len))
: html_engine_new_cell (e, t);
html_table_set_cell (t, r, col, cell);
- html_table_cell_set_position (t->cells [r][col], r, col);
+ html_table_cell_set_position (t->cells[r][col], r, col);
}
}
@@ -316,8 +316,8 @@ delete_cells_undo_destroy (HTMLUndoData *undo_data)
gint i;
for (i = 0; i < data->size; i++)
- if (data->cells [i])
- html_object_destroy (HTML_OBJECT (data->cells [i]));
+ if (data->cells[i])
+ html_object_destroy (HTML_OBJECT (data->cells[i]));
g_free(data->cells);
}
@@ -399,22 +399,22 @@ html_table_delete_column (HTMLTable *t, HTMLEngine *e, gint col, HTMLUndoDirecti
html_engine_goto_table_0 (e, t);
for (r = 0; r < t->totalRows; r++) {
- cell = t->cells [r][col];
+ cell = t->cells[r][col];
/* remove & keep old one */
if (cell && cell->col == col) {
HTML_OBJECT (cell)->parent = NULL;
- column [r] = cell;
- t->cells [r][col] = NULL;
+ column[r] = cell;
+ t->cells[r][col] = NULL;
}
for (c = col + 1; c < t->totalCols; c++) {
- cell = t->cells [r][c];
+ cell = t->cells[r][c];
if (cell && cell->col != col) {
if (cell->row == r && cell->col == c)
html_table_cell_set_position (cell, r, c - 1);
- t->cells [r][c - 1] = cell;
- t->cells [r][c] = NULL;
+ t->cells[r][c - 1] = cell;
+ t->cells[r][c] = NULL;
}
}
}
@@ -533,30 +533,30 @@ html_table_insert_row (HTMLTable *t, HTMLEngine *e, gint row, HTMLTableCell **ro
html_table_alloc_cell (t, t->totalRows, 0);
for (r = t->totalRows; r > row; r--) {
for (c = 0; c < t->totalCols; c++) {
- HTMLTableCell *cell = t->cells [r - 1][c];
+ HTMLTableCell *cell = t->cells[r - 1][c];
if (cell) {
if (cell->row == r - 1) {
html_table_cell_set_position (cell, r, cell->col);
- t->cells [r - 1][c] = NULL;
+ t->cells[r - 1][c] = NULL;
} else if (r == row + 1 && cell->col == c)
cell->rspan++;
if (cell->row > r - 1)
- t->cells [r - 1][c] = NULL;
- t->cells [r][c] = cell;
+ t->cells[r - 1][c] = NULL;
+ t->cells[r][c] = cell;
}
}
}
for (c = 0; c < t->totalCols; c++) {
- if (!t->cells [row][c]) {
+ if (!t->cells[row][c]) {
guint len;
cell = row_cells
- ? HTML_TABLE_CELL (html_object_op_copy (HTML_OBJECT (row_cells [c]), HTML_OBJECT (t),
+ ? HTML_TABLE_CELL (html_object_op_copy (HTML_OBJECT (row_cells[c]), HTML_OBJECT (t),
e, NULL, NULL, &len))
: html_engine_new_cell (e, t);
html_table_set_cell (t, row, c, cell);
- html_table_cell_set_position (t->cells [row][c], row, c);
+ html_table_cell_set_position (t->cells[row][c], row, c);
}
}
@@ -654,22 +654,22 @@ html_table_delete_row (HTMLTable *t, HTMLEngine *e, gint row, HTMLUndoDirection
html_engine_goto_table_0 (e, t);
for (c = 0; c < t->totalCols; c++) {
- cell = t->cells [row][c];
+ cell = t->cells[row][c];
/* remove & keep old one */
if (cell && cell->row == row) {
HTML_OBJECT (cell)->parent = NULL;
- row_cells [c] = cell;
- t->cells [row][c] = NULL;
+ row_cells[c] = cell;
+ t->cells[row][c] = NULL;
}
for (r = row + 1; r < t->totalRows; r++) {
- cell = t->cells [r][c];
+ cell = t->cells[r][c];
if (cell && cell->row != row) {
if (cell->row == r && cell->col == c)
html_table_cell_set_position (cell, r - 1, c);
- t->cells [r - 1][c] = cell;
- t->cells [r][c] = NULL;
+ t->cells[r - 1][c] = cell;
+ t->cells[r][c] = NULL;
}
}
}
@@ -1023,9 +1023,9 @@ table_set_padding (HTMLEngine *e, HTMLTable *t, gint padding, gboolean relative,
t->padding = new_padding;
for (r = 0; r < t->totalRows; r++)
for (c = 0; c < t->totalCols; c++)
- if (t->cells [r][c]->col == c && t->cells [r][c]->row == r) {
- HTML_CLUEV (t->cells [r][c])->padding = new_padding;
- HTML_OBJECT (t->cells [r][c])->change |= HTML_CHANGE_ALL_CALC;
+ if (t->cells[r][c]->col == c && t->cells[r][c]->row == r) {
+ HTML_CLUEV (t->cells[r][c])->padding = new_padding;
+ HTML_OBJECT (t->cells[r][c])->change |= HTML_CHANGE_ALL_CALC;
}
html_object_change_set (HTML_OBJECT (t), HTML_CHANGE_ALL_CALC);
html_engine_schedule_update (e);
diff --git a/gtkhtml/htmlengine-edit-tablecell.c b/gtkhtml/htmlengine-edit-tablecell.c
index 45e7422..68987b6 100644
--- a/gtkhtml/htmlengine-edit-tablecell.c
+++ b/gtkhtml/htmlengine-edit-tablecell.c
@@ -450,8 +450,8 @@ move_cell_rd_undo_free (struct MoveCellRDUndo *undo)
gint i;
for (i = 0; i < undo->rspan*undo->cspan; i++)
- if (undo->removed [i])
- html_object_destroy (HTML_OBJECT (undo->removed [i]));
+ if (undo->removed[i])
+ html_object_destroy (HTML_OBJECT (undo->removed[i]));
g_free (undo->removed);
g_free (undo->moved);
}
@@ -472,11 +472,11 @@ move_cell_rd (HTMLTable *t, HTMLTableCell *cell, gint rs, gint cs)
gint nr = rs + r - (rs ? cell->rspan : 0), nc = cs + c - (cs ? cell->cspan : 0);
/* printf ("exchange: %dx%d <--> %dx%d (%p)\n", rs + r, cs + c, nr, nc, t->cells [rs][nc]); */
- t->cells [nr][nc] = t->cells [rs + r][cs + c];
- if (t->cells [nr][nc]) {
- struct Move *move = &undo->moved [(r - cell->row)*cell->cspan + c - cell->col];
+ t->cells[nr][nc] = t->cells[rs + r][cs + c];
+ if (t->cells[nr][nc]) {
+ struct Move *move = &undo->moved[(r - cell->row)*cell->cspan + c - cell->col];
- html_table_cell_set_position (t->cells [nr][nc], nr, nc);
+ html_table_cell_set_position (t->cells[nr][nc], nr, nc);
move->rs = rs + r;
move->cs = cs + c;
move->rt = nr;
@@ -486,16 +486,16 @@ move_cell_rd (HTMLTable *t, HTMLTableCell *cell, gint rs, gint cs)
}
} else {
if (r >= cell->row + rs && c >= cell->col + cs) {
- if (t->cells [rs + r][cs + c] && t->cells [rs + r][cs + c]->col == cs + c && t->cells [rs + r][cs + c]->row == rs + r) {
+ if (t->cells[rs + r][cs + c] && t->cells[rs + r][cs + c]->col == cs + c && t->cells[rs + r][cs + c]->row == rs + r) {
/* printf ("move destroy: %dx%d\n", rs + r, cs + c); */
/* html_object_destroy (HTML_OBJECT (t->cells [rs + r][cs + c])); */
/* printf ("removed: %dx%d (%d, %d)\n", rs + r, cs + c, r - cell->row, c - cell->col); */
- undo->removed [(r - cell->row)*cell->cspan + c - cell->col] = t->cells [r][c];
+ undo->removed[(r - cell->row)*cell->cspan + c - cell->col] = t->cells[r][c];
}
- t->cells [r][c] = NULL;
+ t->cells[r][c] = NULL;
}
}
- t->cells [rs + r][cs + c] = cell;
+ t->cells[rs + r][cs + c] = cell;
/* printf ("cell %dx%d <--\n", rs + r, cs + c); */
}
/* printf ("set %dx%d --> %dx%d\n", cell->row, cell->col, cell->row + rs, cell->col + cs); */
@@ -545,26 +545,26 @@ expand_undo_data_new (gint span, GSList *slist)
static void
move_cell_rd_undo (HTMLTable *table, struct MoveCellRDUndo *undo)
{
- HTMLTableCell *cell = table->cells [undo->move.rt][undo->move.ct];
+ HTMLTableCell *cell = table->cells[undo->move.rt][undo->move.ct];
gint r, c;
for (r = 0; r < undo->rspan; r++)
for (c = 0; c < undo->cspan; c++)
- if (undo->moved [r*undo->cspan + c].move) {
- struct Move *move = &undo->moved [r*undo->cspan + c];
+ if (undo->moved[r*undo->cspan + c].move) {
+ struct Move *move = &undo->moved[r*undo->cspan + c];
/* printf ("move back: %dx%d --> %dx%d (%d, %d) %p\n", move->rt, move->ct, move->rs, move->cs, r, c, table->cells [move->rt][move->ct]); */
- table->cells [move->rs][move->cs] = table->cells [move->rt][move->ct];
- html_table_cell_set_position (table->cells [move->rs][move->cs], move->rs, move->cs);
- table->cells [move->rt][move->ct] = NULL;
+ table->cells[move->rs][move->cs] = table->cells[move->rt][move->ct];
+ html_table_cell_set_position (table->cells[move->rs][move->cs], move->rs, move->cs);
+ table->cells[move->rt][move->ct] = NULL;
}
for (r = 0; r < cell->rspan; r++)
for (c = 0; c < cell->cspan; c++)
- table->cells [undo->move.rt + r][undo->move.ct + c] = NULL;
+ table->cells[undo->move.rt + r][undo->move.ct + c] = NULL;
for (r = 0; r < cell->rspan; r++)
for (c = 0; c < cell->cspan; c++)
- table->cells [undo->move.rs + r][undo->move.cs + c] = cell;
+ table->cells[undo->move.rs + r][undo->move.cs + c] = cell;
html_table_cell_set_position (cell, undo->move.rs, undo->move.cs);
}
@@ -602,13 +602,13 @@ expand_cspan (HTMLEngine *e, HTMLTableCell *cell, gint cspan, HTMLUndoDirection
move_rows = g_new0 (gint, cell->rspan);
for (r = cell->row; r < cell->row + cell->rspan; r++)
for (c = cell->col + cell->cspan; c < MIN (cell->col + cspan, table->totalCols); c++)
- if (table->cells [r][c] && !html_clue_is_empty (HTML_CLUE (table->cells [r][c])) && move_rows [r - cell->row] == 0)
- move_rows [r - cell->row] = cspan - (c - cell->col);
+ if (table->cells[r][c] && !html_clue_is_empty (HTML_CLUE (table->cells[r][c])) && move_rows[r - cell->row] == 0)
+ move_rows[r - cell->row] = cspan - (c - cell->col);
max_move = 0;
for (r = 0; r < cell->rspan; r++)
- if (move_rows [r] > max_move)
- max_move = move_rows [r];
+ if (move_rows[r] > max_move)
+ max_move = move_rows[r];
add_cols = MAX (max_move, cspan - (table->totalCols - cell->col));
/* printf ("max move: %d add: %d\n", max_move, add_cols); */
@@ -618,7 +618,7 @@ expand_cspan (HTMLEngine *e, HTMLTableCell *cell, gint cspan, HTMLUndoDirection
if (max_move > 0) {
for (c = table->totalCols - max_move - 1; c >= cell->col + cspan - max_move; c--)
for (r = cell->row; r < cell->row + cell->rspan; r++) {
- HTMLTableCell *ccell = table->cells [r][c];
+ HTMLTableCell *ccell = table->cells[r][c];
if (ccell && ccell->col == c) {
slist = g_slist_prepend (slist, move_cell_rd (table, ccell, 0, max_move));
@@ -631,7 +631,7 @@ expand_cspan (HTMLEngine *e, HTMLTableCell *cell, gint cspan, HTMLUndoDirection
cell->cspan = cspan;
for (r = cell->row; r < cell->row + cell->rspan; r++)
for (c = cell->col; c < cell->col + cell->cspan; c++)
- table->cells [r][c] = cell;
+ table->cells[r][c] = cell;
html_object_change_set (HTML_OBJECT (cell), HTML_CHANGE_ALL);
}
@@ -683,9 +683,9 @@ collapse_cspan (HTMLEngine *e, HTMLTableCell *cell, gint cspan, HTMLUndoDirectio
table = HTML_TABLE (HTML_OBJECT (cell)->parent);
for (c = cell->col + cspan; c < cell->col + cell->cspan; c++)
for (r = cell->row; r < cell->row + cell->rspan; r++) {
- table->cells [r][c] = NULL;
+ table->cells[r][c] = NULL;
html_table_set_cell (table, r, c, html_engine_new_cell (e, table));
- html_table_cell_set_position (table->cells [r][c], r, c);
+ html_table_cell_set_position (table->cells[r][c], r, c);
}
collapse_cspan_setup_undo (e, cell->cspan, position_before, dir);
@@ -721,13 +721,13 @@ calc_rspan_max_move (HTMLTableCell *cell, gint rspan)
move_cols = g_new0 (gint, cell->cspan);
for (c = cell->col; c < cell->col + cell->cspan; c++)
for (r = cell->row + cell->rspan; r < MIN (cell->row + rspan, table->totalRows); r++)
- if (table->cells [r][c] && !html_clue_is_empty (HTML_CLUE (table->cells [r][c])) && move_cols [c - cell->col] == 0)
- move_cols [c - cell->col] = rspan - (r - cell->row);
+ if (table->cells[r][c] && !html_clue_is_empty (HTML_CLUE (table->cells[r][c])) && move_cols[c - cell->col] == 0)
+ move_cols[c - cell->col] = rspan - (r - cell->row);
max_move = 0;
for (c = 0; c < cell->cspan; c++)
- if (move_cols [c] > max_move)
- max_move = move_cols [c];
+ if (move_cols[c] > max_move)
+ max_move = move_cols[c];
g_free (move_cols);
return max_move;
@@ -749,7 +749,7 @@ expand_rspan (HTMLEngine *e, HTMLTableCell *cell, gint rspan, HTMLUndoDirection
if (max_move > 0) {
for (r = table->totalRows - max_move - 1; r >= cell->row + rspan - max_move; r--)
for (c = cell->col; c < cell->col + cell->cspan; c++) {
- HTMLTableCell *ccell = table->cells [r][c];
+ HTMLTableCell *ccell = table->cells[r][c];
if (ccell && ccell->row == r) {
slist = g_slist_prepend (slist, move_cell_rd (table, ccell, max_move, 0));
@@ -761,7 +761,7 @@ expand_rspan (HTMLEngine *e, HTMLTableCell *cell, gint rspan, HTMLUndoDirection
cell->rspan = rspan;
for (r = cell->row; r < cell->row + cell->rspan; r++)
for (c = cell->col; c < cell->col + cell->cspan; c++)
- table->cells [r][c] = cell;
+ table->cells[r][c] = cell;
html_object_change_set (HTML_OBJECT (cell), HTML_CHANGE_ALL);
}
@@ -794,9 +794,9 @@ collapse_rspan (HTMLEngine *e, HTMLTableCell *cell, gint rspan, HTMLUndoDirectio
table = HTML_TABLE (HTML_OBJECT (cell)->parent);
for (r = cell->row + rspan; r < cell->row + cell->rspan; r++)
for (c = cell->col; c < cell->col + cell->cspan; c++) {
- table->cells [r][c] = NULL;
+ table->cells[r][c] = NULL;
html_table_set_cell (table, r, c, html_engine_new_cell (e, table));
- html_table_cell_set_position (table->cells [r][c], r, c);
+ html_table_cell_set_position (table->cells[r][c], r, c);
}
collapse_rspan_setup_undo (e, cell->rspan, position_before, dir);
diff --git a/gtkhtml/htmlengine-save.c b/gtkhtml/htmlengine-save.c
index 5fee260..1bbf80a 100644
--- a/gtkhtml/htmlengine-save.c
+++ b/gtkhtml/htmlengine-save.c
@@ -230,7 +230,7 @@ html_engine_save_delims_and_vals (HTMLEngineSaveState *state,
static gchar *
color_to_string (const gchar *s, HTMLColor *c)
{
- gchar color [20];
+ gchar color[20];
g_snprintf (color, 20, " %s=\"#%02x%02x%02x\"", s, c->color.red >> 8, c->color.green >> 8, c->color.blue >> 8);
return g_strdup (color);
diff --git a/gtkhtml/htmlengine.c b/gtkhtml/htmlengine.c
index edcaec0..ecf80be 100644
--- a/gtkhtml/htmlengine.c
+++ b/gtkhtml/htmlengine.c
@@ -154,7 +154,7 @@ enum {
LAST_SIGNAL
};
-static guint signals [LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
#define TIMER_INTERVAL 300
#define DT(x);
@@ -812,7 +812,7 @@ close_flow (HTMLEngine *e, HTMLObject *clue)
} else if (last != HTML_CLUE (e->flow)->head
&& html_object_is_text (last)
&& HTML_TEXT (last)->text_len == 1
- && HTML_TEXT (last)->text [0] == ' ') {
+ && HTML_TEXT (last)->text[0] == ' ') {
html_clue_remove (HTML_CLUE (e->flow), last);
html_object_destroy (last);
}
@@ -906,7 +906,7 @@ insert_text (HTMLEngine *e,
g_return_if_fail (HTML_IS_ENGINE (e));
- if (text [0] == ' ' && text [1] == 0) {
+ if (text[0] == ' ' && text[1] == 0) {
if (e->eat_space)
return;
else
@@ -1339,7 +1339,7 @@ block_end_title (HTMLEngine *e, HTMLObject *clue, HTMLElement *elem)
* valid title
*/
if (e->inTitle && e->title)
- g_signal_emit (e, signals [TITLE_CHANGED], 0);
+ g_signal_emit (e, signals[TITLE_CHANGED], 0);
e->inTitle = FALSE;
}
@@ -1404,7 +1404,7 @@ new_parse_body (HTMLEngine *e, const gchar *end[])
gchar *str = token + 1;
gint i = 0;
- while (end [i] != 0) {
+ while (end[i] != 0) {
if (g_ascii_strncasecmp (str, end[i], strlen(end[i])) == 0) {
rv = str;
}
@@ -1465,7 +1465,7 @@ discard_body (HTMLEngine *p, const gchar *end[])
else {
gint i = 0;
- while (end [i] != 0) {
+ while (end[i] != 0) {
if (g_ascii_strncasecmp (str + 1, end[i], strlen(end[i])) == 0) {
g_free (str);
return TRUE;
@@ -1632,7 +1632,7 @@ element_parse_object (HTMLEngine *e, HTMLObject *clue, const gchar *attr)
gtk_html_debug_log (e->widget,
"requesting object classid: %s\n",
classid ? classid : "(null)");
- g_signal_emit (e, signals [OBJECT_REQUESTED], 0, eb, &object_found);
+ g_signal_emit (e, signals[OBJECT_REQUESTED], 0, eb, &object_found);
gtk_html_debug_log (e->widget, "object_found: %d\n", object_found);
/* show alt text on TRUE */
@@ -2159,7 +2159,7 @@ element_parse_body (HTMLEngine *e, HTMLObject *clue, const gchar *str)
gtk_html_debug_log (e->widget, "Color `%s' could not be parsed\n", token);
}
} else if (g_ascii_strncasecmp (token, "background=", 11) == 0
- && token [12]
+ && token[12]
&& !e->defaultSettings->forceDefault) {
gchar *bgurl;
@@ -2219,9 +2219,9 @@ element_parse_base (HTMLEngine *e, HTMLObject *clue, const gchar *str)
while (html_string_tokenizer_has_more_tokens (e->st)) {
const gchar * token = html_string_tokenizer_next_token(e->st);
if (g_ascii_strncasecmp( token, "target=", 7 ) == 0) {
- g_signal_emit (e, signals [SET_BASE_TARGET], 0, token + 7);
+ g_signal_emit (e, signals[SET_BASE_TARGET], 0, token + 7);
} else if (g_ascii_strncasecmp( token, "href=", 5 ) == 0) {
- g_signal_emit (e, signals [SET_BASE], 0, token + 5);
+ g_signal_emit (e, signals[SET_BASE], 0, token + 5);
}
}
}
@@ -2849,7 +2849,7 @@ element_parse_meta (HTMLEngine *e, HTMLObject *clue, const gchar *str)
refresh_url = g_strdup (token + 4);
}
- g_signal_emit (e, signals [REDIRECT], 0, refresh_url, refresh_delay);
+ g_signal_emit (e, signals[REDIRECT], 0, refresh_url, refresh_delay);
if (refresh_url)
g_free(refresh_url);
}
@@ -4268,7 +4268,7 @@ html_engine_class_init (HTMLEngineClass *klass)
parent_class = g_type_class_ref (G_TYPE_OBJECT);
- signals [SET_BASE] =
+ signals[SET_BASE] =
g_signal_new ("set_base",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4278,7 +4278,7 @@ html_engine_class_init (HTMLEngineClass *klass)
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [SET_BASE_TARGET] =
+ signals[SET_BASE_TARGET] =
g_signal_new ("set_base_target",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4288,7 +4288,7 @@ html_engine_class_init (HTMLEngineClass *klass)
G_TYPE_NONE, 1,
G_TYPE_STRING);
- signals [LOAD_DONE] =
+ signals[LOAD_DONE] =
g_signal_new ("load_done",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4297,7 +4297,7 @@ html_engine_class_init (HTMLEngineClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [TITLE_CHANGED] =
+ signals[TITLE_CHANGED] =
g_signal_new ("title_changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4306,7 +4306,7 @@ html_engine_class_init (HTMLEngineClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [URL_REQUESTED] =
+ signals[URL_REQUESTED] =
g_signal_new ("url_requested",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4317,7 +4317,7 @@ html_engine_class_init (HTMLEngineClass *klass)
G_TYPE_STRING,
G_TYPE_POINTER);
- signals [DRAW_PENDING] =
+ signals[DRAW_PENDING] =
g_signal_new ("draw_pending",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4326,7 +4326,7 @@ html_engine_class_init (HTMLEngineClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- signals [REDIRECT] =
+ signals[REDIRECT] =
g_signal_new ("redirect",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4337,7 +4337,7 @@ html_engine_class_init (HTMLEngineClass *klass)
G_TYPE_STRING,
G_TYPE_INT);
- signals [SUBMIT] =
+ signals[SUBMIT] =
g_signal_new ("submit",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -4349,7 +4349,7 @@ html_engine_class_init (HTMLEngineClass *klass)
G_TYPE_STRING,
G_TYPE_STRING);
- signals [OBJECT_REQUESTED] =
+ signals[OBJECT_REQUESTED] =
g_signal_new ("object_requested",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
@@ -4359,7 +4359,7 @@ html_engine_class_init (HTMLEngineClass *klass)
G_TYPE_BOOLEAN, 1,
G_TYPE_OBJECT);
- signals [UNDO_CHANGED] =
+ signals[UNDO_CHANGED] =
g_signal_new ("undo-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
@@ -5045,7 +5045,7 @@ html_engine_stream_end (GtkHTMLStream *stream,
gtk_widget_queue_resize (GTK_WIDGET (e->widget));
- g_signal_emit (e, signals [LOAD_DONE], 0);
+ g_signal_emit (e, signals[LOAD_DONE], 0);
}
static void
@@ -5649,7 +5649,7 @@ html_engine_form_submitted (HTMLEngine *e,
const gchar *action,
const gchar *encoding)
{
- g_signal_emit (e, signals [SUBMIT], 0, method, action, encoding);
+ g_signal_emit (e, signals[SUBMIT], 0, method, action, encoding);
}
@@ -6168,12 +6168,12 @@ html_engine_get_spell_word (HTMLEngine *e)
/* move to the end of word */
cited2 = FALSE;
while (html_selection_spell_word (uc = html_cursor_get_current_char (cursor), &cited2) || (!cited && cited2)) {
- gchar out [7];
+ gchar out[7];
gint size;
size = g_unichar_to_utf8 (uc, out);
g_assert (size < 7);
- out [size] = 0;
+ out[size] = 0;
text = g_string_append (text, out);
html_cursor_forward (cursor, e);
cited2 = FALSE;
@@ -7033,5 +7033,5 @@ html_engine_emit_undo_changed (HTMLEngine *e)
g_return_if_fail (e != NULL);
g_return_if_fail (HTML_IS_ENGINE (e));
- g_signal_emit (e, signals [UNDO_CHANGED], 0);
+ g_signal_emit (e, signals[UNDO_CHANGED], 0);
}
diff --git a/gtkhtml/htmlfontmanager.c b/gtkhtml/htmlfontmanager.c
index 252595e..4f3739f 100644
--- a/gtkhtml/htmlfontmanager.c
+++ b/gtkhtml/htmlfontmanager.c
@@ -65,9 +65,9 @@ html_font_set_release (HTMLFontSet *set, HTMLPainter *painter)
gint i;
for (i=0; i<GTK_HTML_FONT_STYLE_MAX_FONT; i++) {
- if (set->font [i])
- html_font_unref (set->font [i], painter);
- set->font [i] = NULL;
+ if (set->font[i])
+ html_font_unref (set->font[i], painter);
+ set->font[i] = NULL;
}
}
@@ -224,9 +224,9 @@ html_font_set_font (HTMLFontManager *manager, HTMLFontSet *set, GtkHTMLFontStyle
/* set font in font set */
idx = html_font_set_get_idx (style);
- if (set->font [idx] && font != set->font [idx])
- html_font_unref (set->font [idx], manager->painter);
- set->font [idx] = font;
+ if (set->font[idx] && font != set->font[idx])
+ html_font_unref (set->font[idx], manager->painter);
+ set->font[idx] = font;
}
static HTMLFont *
@@ -236,7 +236,7 @@ get_font (HTMLFontManager *manager, HTMLFontSet **set, gchar *face, GtkHTMLFontS
*set = get_font_set (manager, face, style);
if (*set)
- font = (*set)->font [html_font_set_get_idx (style)];
+ font = (*set)->font[html_font_set_get_idx (style)];
return font;
}
@@ -275,11 +275,11 @@ static gchar *
strip_white_space (gchar *name)
{
gint end;
- while (name [0] == ' ' || name [0] == '\t')
+ while (name[0] == ' ' || name[0] == '\t')
name++;
end = strlen (name);
- while (end && (name [end - 1] == ' ' || name [end - 1] == '\t')) {
- name [end - 1] = 0;
+ while (end && (name[end - 1] == ' ' || name[end - 1] == '\t')) {
+ name[end - 1] = 0;
end--;
}
diff --git a/gtkhtml/htmlfontmanager.h b/gtkhtml/htmlfontmanager.h
index 83ea2f1..92a9821 100644
--- a/gtkhtml/htmlfontmanager.h
+++ b/gtkhtml/htmlfontmanager.h
@@ -43,7 +43,7 @@ struct _HTMLFont {
};
struct _HTMLFontSet {
- HTMLFont *font [GTK_HTML_FONT_STYLE_MAX_FONT];
+ HTMLFont *font[GTK_HTML_FONT_STYLE_MAX_FONT];
gint ref_count;
gchar *face;
};
diff --git a/gtkhtml/htmlframeset.c b/gtkhtml/htmlframeset.c
index b9a5eb8..0351054 100644
--- a/gtkhtml/htmlframeset.c
+++ b/gtkhtml/htmlframeset.c
@@ -294,7 +294,7 @@ set_max_width (HTMLObject *o, HTMLPainter *painter, gint w)
for (i = 0; i < set->frames->len; i++) {
c = i % set->cols->len;
if (i < set->frames->len)
- html_object_set_max_width (HTML_OBJECT (g_ptr_array_index (set->frames, i)), painter, widths [c]);
+ html_object_set_max_width (HTML_OBJECT (g_ptr_array_index (set->frames, i)), painter, widths[c]);
remain_x -= widths[c];
}
g_free (widths);
diff --git a/gtkhtml/htmlgdkpainter.c b/gtkhtml/htmlgdkpainter.c
index 4e6c3b0..a98992a 100644
--- a/gtkhtml/htmlgdkpainter.c
+++ b/gtkhtml/htmlgdkpainter.c
@@ -800,7 +800,7 @@ draw_glyphs (HTMLPainter *painter, gint x, gint y, PangoItem *item, PangoGlyphSt
cw = draw_lines (glyphs, x, y, gdk_painter->pixmap, gdk_painter->gc, item, &properties);
else
for (i=0; i < glyphs->num_glyphs; i++)
- cw += glyphs->glyphs [i].geometry.width;
+ cw += glyphs->glyphs[i].geometry.width;
if (fg_text_color || fg)
gdk_gc_set_foreground (gdk_painter->gc, &orig_fg.foreground);
diff --git a/gtkhtml/htmlpainter.c b/gtkhtml/htmlpainter.c
index a9e2647..5eabd22 100644
--- a/gtkhtml/htmlpainter.c
+++ b/gtkhtml/htmlpainter.c
@@ -143,7 +143,7 @@ text_width (HTMLPainter *painter, PangoFontDescription *desc, const gchar *text,
for (list = glyphs; list; list = list->next->next) {
PangoGlyphString *str = (PangoGlyphString *) list->data;
for (i=0; i < str->num_glyphs; i++)
- width += str->glyphs [i].geometry.width;
+ width += str->glyphs[i].geometry.width;
}
}
if (glyphs)
@@ -182,7 +182,7 @@ text_size (HTMLPainter *painter, PangoFontDescription *desc, const gchar *text,
str = (PangoGlyphString *) gl->data;
gl = gl->next;
ii = GPOINTER_TO_INT (gl->data);
- item = pi->entries [ii].glyph_item.item;
+ item = pi->entries[ii].glyph_item.item;
pango_glyph_string_extents (str, item->analysis.font, NULL, &log_rect);
width += log_rect.width;
@@ -1014,7 +1014,7 @@ html_painter_text_itemize_and_prepare_glyphs (HTMLPainter *painter, PangoFontDes
for (il = items; il; il = il->next) {
item = (PangoItem *) il->data;
- pi->entries [i].glyph_item.item = item;
+ pi->entries[i].glyph_item.item = item;
end = g_utf8_offset_to_pointer (text, item->num_chars);
*glyphs = html_get_glyphs_non_tab (*glyphs, item, i, text, end - text, item->num_chars);
text = end;
diff --git a/gtkhtml/htmlprinter.c b/gtkhtml/htmlprinter.c
index 914868a..13d91fb 100644
--- a/gtkhtml/htmlprinter.c
+++ b/gtkhtml/htmlprinter.c
@@ -94,7 +94,7 @@ begin (HTMLPainter *painter,
gdouble printer_x2, printer_y2;
cairo_t *cr;
#ifdef PRINTER_DEBUG
- gdouble dash [2];
+ gdouble dash[2];
#endif
printer = HTML_PRINTER (painter);
g_return_if_fail (printer);
@@ -113,8 +113,8 @@ begin (HTMLPainter *painter,
cairo_rectangle (cr, printer_x1, printer_y1, printer_x2, printer_y2);
#ifdef PRINTER_DEBUG
cairo_save (cr);
- dash [0] = 10.0;
- dash [1] = 10.0;
+ dash[0] = 10.0;
+ dash[1] = 10.0;
cairo_set_source_rgb (cr, .5, .5, .5);
cairo_set_line_width (cr, .3);
cairo_set_dash (cr, 2, dash, .0);
diff --git a/gtkhtml/htmlsearch.c b/gtkhtml/htmlsearch.c
index 9b902b4..73eee0c 100644
--- a/gtkhtml/htmlsearch.c
+++ b/gtkhtml/htmlsearch.c
@@ -25,7 +25,7 @@
position of paragraph. so it is possible to find first match
on bottom of page (ie. first column of table) and the second
one on top (ie. top of second comlumn)
- [also Netscape didn't take care of it]
+ [also Netscape didn't take care of it]
*/
diff --git a/gtkhtml/htmlsettings.h b/gtkhtml/htmlsettings.h
index b14b395..cb32a94 100644
--- a/gtkhtml/htmlsettings.h
+++ b/gtkhtml/htmlsettings.h
@@ -34,7 +34,7 @@
#define HTML_NUM_FONT_SIZES 7
struct _HTMLSettings {
- gint fontSizes [HTML_NUM_FONT_SIZES];
+ gint fontSizes[HTML_NUM_FONT_SIZES];
gint fontBaseSize;
gchar *fontBaseFace;
diff --git a/gtkhtml/htmlstyle.c b/gtkhtml/htmlstyle.c
index 7c3a2e9..c884ef8 100644
--- a/gtkhtml/htmlstyle.c
+++ b/gtkhtml/htmlstyle.c
@@ -29,7 +29,7 @@ gboolean
html_parse_color (const gchar *text,
GdkColor *color)
{
- gchar c [8];
+ gchar c[8];
gint len = strlen (text);
if (gdk_color_parse (text, color)) {
@@ -64,7 +64,7 @@ html_parse_color (const gchar *text,
}
}
- c [7] = 0;
+ c[7] = 0;
if (*text != '#') {
c[0] = '#';
strncpy (c + 1, text, 6);
diff --git a/gtkhtml/htmltable.c b/gtkhtml/htmltable.c
index dde5148..a5c4c9e 100644
--- a/gtkhtml/htmltable.c
+++ b/gtkhtml/htmltable.c
@@ -72,9 +72,9 @@ static void html_table_set_max_width (HTMLObject *o, HTMLPainter *painter, gint
static inline gboolean
invalid_cell (HTMLTable *table, gint r, gint c)
{
- return (table->cells [r][c] == NULL
- || c != table->cells [r][c]->col
- || r != table->cells [r][c]->row);
+ return (table->cells[r][c] == NULL
+ || c != table->cells[r][c]->col
+ || r != table->cells[r][c]->row);
}
/* HTMLObject methods. */
@@ -94,7 +94,7 @@ destroy (HTMLObject *o)
if (c == 0)
break;
}
- g_free (table->cells [r]);
+ g_free (table->cells[r]);
if (r == 0)
break;
}
@@ -140,7 +140,7 @@ copy_sized (HTMLObject *self, HTMLObject *dest, gint rows, gint cols)
d->cells = g_new (HTMLTableCell **, rows);
for (r = 0; r < rows; r++)
- d->cells [r] = g_new0 (HTMLTableCell *, cols);
+ d->cells[r] = g_new0 (HTMLTableCell *, cols);
dest->change = HTML_CHANGE_ALL_CALC;
}
@@ -201,12 +201,12 @@ op_copy (HTMLObject *self, HTMLObject *parent, HTMLEngine *e, GList *from, GList
#endif
for (r = 0; r < rows; r++)
for (c = 0; c < cols; c++) {
- HTMLTableCell *cell = t->cells [start->row + r][c + start_col];
+ HTMLTableCell *cell = t->cells[start->row + r][c + start_col];
if (!cell || (end->row != start->row
&& ((r == 0 && c < start->col) || (r == rows - 1 && c > end->col)))) {
html_table_set_cell (nt, r, c, html_engine_new_cell (e, nt));
- html_table_cell_set_position (nt->cells [r][c], r, c);
+ html_table_cell_set_position (nt->cells[r][c], r, c);
} else {
if (cell->row == r + start->row && cell->col == c + start_col) {
HTMLTableCell *cell_copy;
@@ -219,10 +219,10 @@ op_copy (HTMLObject *self, HTMLObject *parent, HTMLEngine *e, GList *from, GList
html_table_cell_set_position (cell_copy, r, c);
} else {
if (cell->row - start->row >= 0 && cell->col - start_col >= 0) {
- nt->cells [r][c] = nt->cells [cell->row - start->row][cell->col - start_col];
+ nt->cells[r][c] = nt->cells[cell->row - start->row][cell->col - start_col];
} else {
html_table_set_cell (nt, r, c, html_engine_new_cell (e, nt));
- html_table_cell_set_position (nt->cells [r][c], r, c);
+ html_table_cell_set_position (nt->cells[r][c], r, c);
}
}
}
@@ -245,7 +245,7 @@ get_n_children (HTMLObject *self)
for (r = 0; r < t->totalRows; r++)
for (c = 0; c < t->totalCols; c++)
- if (t->cells [r][c] && t->cells [r][c]->row == r && t->cells [r][c]->col == c)
+ if (t->cells[r][c] && t->cells[r][c]->row == r && t->cells[r][c]->col == c)
n_children++;
/* printf ("table n_children %d\n", n_children); */
@@ -262,9 +262,9 @@ get_child (HTMLObject *self, gint index)
for (r = 0; r < t->totalRows && !child; r++)
for (c = 0; c < t->totalCols; c++)
- if (t->cells [r][c] && t->cells [r][c]->row == r && t->cells [r][c]->col == c) {
+ if (t->cells[r][c] && t->cells[r][c]->row == r && t->cells[r][c]->col == c) {
if (n == index) {
- child = HTML_OBJECT (t->cells [r][c]);
+ child = HTML_OBJECT (t->cells[r][c]);
break;
}
n++;
@@ -284,8 +284,8 @@ get_child_index (HTMLObject *self, HTMLObject *child)
for (r = 0; r < t->totalRows; r++)
for (c = 0; c < t->totalCols; c++) {
- if (t->cells [r][c] && t->cells [r][c]->row == r && t->cells [r][c]->col == c) {
- if (HTML_OBJECT (t->cells [r][c]) == child) {
+ if (t->cells[r][c] && t->cells[r][c]->row == r && t->cells[r][c]->col == c) {
+ if (HTML_OBJECT (t->cells[r][c]) == child) {
/* printf ("table child %p index %d\n", child, n); */
return n;
}
@@ -306,8 +306,8 @@ get_recursive_length (HTMLObject *self)
for (r = 0; r < t->totalRows; r++)
for (c = 0; c < t->totalCols; c++)
- if (t->cells [r][c] && t->cells [r][c]->row == r && t->cells [r][c]->col == c)
- len += html_object_get_recursive_length (HTML_OBJECT (t->cells [r][c])) + 1;
+ if (t->cells[r][c] && t->cells[r][c]->row == r && t->cells[r][c]->col == c)
+ len += html_object_get_recursive_length (HTML_OBJECT (t->cells[r][c])) + 1;
/* if (len > 0)
len--; */
@@ -338,7 +338,7 @@ remove_cell (HTMLTable *t, HTMLTableCell *cell)
cell->row + r, cell->col + c, cell->rspan, cell->cspan, r, c);
#endif
- t->cells [cell->row + r][cell->col + c] = NULL;
+ t->cells[cell->row + r][cell->col + c] = NULL;
}
HTML_OBJECT (cell)->parent = NULL;
}
@@ -384,12 +384,12 @@ cut_partial (HTMLObject *self, HTMLEngine *e, GList *from, GList *to, GList *lef
for (r = 0; r < t->totalRows; r++) {
for (c = 0; c < t->totalCols; c++) {
- cell = t->cells [r][c];
+ cell = t->cells[r][c];
if (cell && cell->row == r && cell->col == c) {
if (((r == start_row && c < start_col) || r < start_row)
|| ((r == end_row && c > end_col) || r > end_row)) {
html_table_set_cell (nt, r, c, html_engine_new_cell (e, nt));
- html_table_cell_set_position (nt->cells [r][c], r, c);
+ html_table_cell_set_position (nt->cells[r][c], r, c);
} else {
HTMLTableCell *cell_cut;
@@ -402,9 +402,9 @@ cut_partial (HTMLObject *self, HTMLEngine *e, GList *from, GList *to, GList *lef
html_table_set_cell (nt, r, c, cell_cut);
html_table_cell_set_position (cell_cut, r, c);
- if (t->cells [r][c] == NULL) {
+ if (t->cells[r][c] == NULL) {
html_table_set_cell (t, r, c, html_engine_new_cell (e, t));
- html_table_cell_set_position (t->cells [r][c], r, c);
+ html_table_cell_set_position (t->cells[r][c], r, c);
}
}
(*len) ++;
@@ -474,20 +474,20 @@ split (HTMLObject *self, HTMLEngine *e, HTMLObject *child, gint offset, gint lev
for (c = 0; c < t->totalCols; c++) {
HTMLTableCell *cc;
- cc = t->cells [r][c];
+ cc = t->cells[r][c];
if (cc && cc->row == r && cc->col == c) {
if ((r == cell->row && c < cell->col) || r < cell->row) {
/* empty cell in dup table */
html_table_set_cell (dup_table, r, c, html_engine_new_cell (e, dup_table));
- html_table_cell_set_position (dup_table->cells [r][c], r, c);
+ html_table_cell_set_position (dup_table->cells[r][c], r, c);
} else if ((r == dup_cell->row && c > dup_cell->col) || r > dup_cell->row) {
/* move cc to dup table */
remove_cell (t, cc);
html_table_set_cell (dup_table, r, c, cc);
- html_table_cell_set_position (dup_table->cells [r][c], r, c);
+ html_table_cell_set_position (dup_table->cells[r][c], r, c);
/* place empty cell in t table */
html_table_set_cell (t, r, c, html_engine_new_cell (e, t));
- html_table_cell_set_position (t->cells [r][c], r, c);
+ html_table_cell_set_position (t->cells[r][c], r, c);
} else {
if (r == cell->row && c == cell->col) {
@@ -495,7 +495,7 @@ split (HTMLObject *self, HTMLEngine *e, HTMLObject *child, gint offset, gint lev
/* empty cell in dup table */
html_table_set_cell (dup_table, r, c,
html_engine_new_cell (e, dup_table));
- html_table_cell_set_position (dup_table->cells [r][c], r, c);
+ html_table_cell_set_position (dup_table->cells[r][c], r, c);
}
}
@@ -506,12 +506,12 @@ split (HTMLObject *self, HTMLEngine *e, HTMLObject *child, gint offset, gint lev
remove_cell (t, cell);
html_table_set_cell (dup_table, r, c, dup_cell);
- html_table_cell_set_position (dup_table->cells [r][c], r, c);
+ html_table_cell_set_position (dup_table->cells[r][c], r, c);
if (r != cell->row || c != cell->col) {
/* empty cell in orig table */
html_table_set_cell (t, r, c, html_engine_new_cell (e, t));
- html_table_cell_set_position (t->cells [r][c], r, c);
+ html_table_cell_set_position (t->cells[r][c], r, c);
}
}
}
@@ -562,8 +562,8 @@ could_merge (HTMLTable *t1, HTMLTable *t2)
for (c = 0; c < t1->totalCols; c++) {
HTMLTableCell *c1, *c2;
- c1 = t1->cells [r][c];
- c2 = t2->cells [r][c];
+ c1 = t1->cells[r][c];
+ c2 = t2->cells[r][c];
if (!c1 || !c2)
return FALSE;
@@ -612,7 +612,7 @@ move_cell (HTMLTable *t1, HTMLTable *t2, HTMLTableCell *c1, HTMLTableCell *c2,
html_object_destroy (HTML_OBJECT (c1));
remove_cell (t2, c2);
html_table_set_cell (t1, r, c, c2);
- html_table_cell_set_position (t1->cells [r][c], r, c);
+ html_table_cell_set_position (t1->cells[r][c], r, c);
}
static gboolean
@@ -657,8 +657,8 @@ merge (HTMLObject *self, HTMLObject *with, HTMLEngine *e, GList **left, GList **
for (c = 0; c < t1->totalCols; c++) {
HTMLTableCell *c1, *c2;
- c1 = t1->cells [r][c];
- c2 = t2->cells [r][c];
+ c1 = t1->cells[r][c];
+ c2 = t2->cells[r][c];
if (first) {
if (!html_clue_is_empty (HTML_CLUE (c2))) {
@@ -772,8 +772,8 @@ previous_rows_do_cspan (HTMLTable *table, gint c)
gint i;
if (c)
for (i=0; i < table->totalRows - 1; i++)
- if (table->cells [i][c - 1])
- do_cspan (table, i, c, table->cells [i][c - 1]);
+ if (table->cells[i][c - 1])
+ do_cspan (table, i, c, table->cells[i][c - 1]);
}
static void
@@ -782,8 +782,8 @@ expand_columns (HTMLTable *table, gint num)
gint r;
for (r = 0; r < table->allocRows; r++) {
- table->cells [r] = g_renew (HTMLTableCell *, table->cells [r], table->totalCols + num);
- memset (table->cells [r] + table->totalCols, 0, num * sizeof (HTMLTableCell *));
+ table->cells[r] = g_renew (HTMLTableCell *, table->cells[r], table->totalCols + num);
+ memset (table->cells[r] + table->totalCols, 0, num * sizeof (HTMLTableCell *));
}
table->totalCols += num;
}
@@ -803,8 +803,8 @@ expand_rows (HTMLTable *table, gint num)
table->cells = g_renew (HTMLTableCell **, table->cells, table->allocRows + num);
for (r = table->allocRows; r < table->allocRows + num; r++) {
- table->cells [r] = g_new (HTMLTableCell *, table->totalCols);
- memset (table->cells [r], 0, table->totalCols * sizeof (HTMLTableCell *));
+ table->cells[r] = g_new (HTMLTableCell *, table->totalCols);
+ memset (table->cells[r], 0, table->totalCols * sizeof (HTMLTableCell *));
}
table->allocRows += num;
@@ -878,8 +878,8 @@ calc_column_width_step (HTMLTable *table, HTMLPainter *painter, GArray *array, g
new_width -= added;
added += new_width;
- if (sizes [cell->col + i] < new_width)
- sizes [cell->col + i] = new_width;
+ if (sizes[cell->col + i] < new_width)
+ sizes[cell->col + i] = new_width;
}
/* printf ("%d added %d col_width %d span_width %d\n",
col_width - added, added, col_width, span_width); */
@@ -911,9 +911,9 @@ calc_column_width_template (HTMLTable *table, HTMLPainter *painter, GArray *arra
add = 0;
for (c = 0; c < table->totalCols; c++) {
ARR (c + 1) += add;
- if (ARR (c + 1) - ARR (c) < arr [c]) {
- add += arr [c] - (ARR (c + 1) - ARR (c));
- ARR (c + 1) = ARR (c) + arr [c];
+ if (ARR (c + 1) - ARR (c) < arr[c]) {
+ add += arr[c] - (ARR (c + 1) - ARR (c));
+ ARR (c + 1) = ARR (c) + arr[c];
}
}
g_free (arr);
@@ -942,10 +942,10 @@ prev_col_do_cspan (HTMLTable *table, gint row)
g_assert (row >= 0);
/* add previous column cell which has cspan > 1 */
- while (table->col < table->totalCols && table->cells [row][table->col] != 0) {
- html_table_alloc_cell (table, row, table->col + table->cells [row][table->col]->cspan);
- do_cspan (table, row, table->col + 1, table->cells [row][table->col]);
- table->col += (table->cells [row][table->col])->cspan;
+ while (table->col < table->totalCols && table->cells[row][table->col] != 0) {
+ html_table_alloc_cell (table, row, table->col + table->cells[row][table->col]->cspan);
+ do_cspan (table, row, table->col + 1, table->cells[row][table->col]);
+ table->col += (table->cells[row][table->col])->cspan;
}
}
@@ -957,22 +957,22 @@ do_rspan (HTMLTable *table, gint row)
g_assert (row > 0);
for (i=0; i<table->totalCols; i++)
- if (table->cells [row - 1][i]
- && (table->cells [row - 1][i])->row + (table->cells [row - 1][i])->rspan
+ if (table->cells[row - 1][i]
+ && (table->cells[row - 1][i])->row + (table->cells[row - 1][i])->rspan
> row) {
- html_table_set_cell (table, table->row, i, table->cells [table->row - 1][i]);
- do_cspan (table, table->row, i + 1, table->cells [table->row -1][i]);
+ html_table_set_cell (table, table->row, i, table->cells[table->row - 1][i]);
+ do_cspan (table, table->row, i + 1, table->cells[table->row -1][i]);
}
}
void
html_table_set_cell (HTMLTable *table, gint r, gint c, HTMLTableCell *cell)
{
- if (!table->cells [r][c]) {
+ if (!table->cells[r][c]) {
#ifdef GTKHTML_DEBUG_TABLE
printf ("set cell: %d,%d %p\n", r, c, cell);
#endif
- table->cells [r][c] = cell;
+ table->cells[r][c] = cell;
HTML_OBJECT (cell)->parent = HTML_OBJECT (table);
}
}
@@ -1244,9 +1244,9 @@ draw (HTMLObject *o,
if (cell == NULL)
continue;
- if (c < end_col && cell == table->cells [r][c + 1])
+ if (c < end_col && cell == table->cells[r][c + 1])
continue;
- if (r < end_row && table->cells [r + 1][c] == cell)
+ if (r < end_row && table->cells[r + 1][c] == cell)
continue;
html_object_draw (HTML_OBJECT (cell), p,
@@ -1361,7 +1361,7 @@ calc_percentage_step (HTMLTable *table, gint *col_percent, gint *span_percent, g
continue;
cl = cell_end_col (table, cell);
- if (col_percent [cl] - col_percent [c] < cell->fixed_width) {
+ if (col_percent[cl] - col_percent[c] < cell->fixed_width) {
gint cp, part, added, pleft, not_percented, np;
part = 0;
not_percented = 0;
@@ -1371,7 +1371,7 @@ calc_percentage_step (HTMLTable *table, gint *col_percent, gint *span_percent, g
np = 1;
added = 0;
- pleft = cell->fixed_width - (col_percent [cl] - col_percent [c]);
+ pleft = cell->fixed_width - (col_percent[cl] - col_percent[c]);
for (cp = 0; cp < span; cp++) {
if (not_percented) {
if (!PERC (c + cp)) {
@@ -1382,17 +1382,17 @@ calc_percentage_step (HTMLTable *table, gint *col_percent, gint *span_percent, g
np++;
}
} else {
- part = ((col_percent [c + cp + 1] - col_percent [c]) * pleft)
- / (col_percent [cl] - col_percent [cell->col]);
- if ((col_percent [c + cp + 1] - col_percent [c]) * pleft
- - part * (col_percent [cl] - col_percent [c])
- > (part + 1) * (col_percent [cl] - col_percent [c])
- - (col_percent [c + cp + 1] - col_percent [c]) * pleft)
+ part = ((col_percent[c + cp + 1] - col_percent[c]) * pleft)
+ / (col_percent[cl] - col_percent[cell->col]);
+ if ((col_percent[c + cp + 1] - col_percent[c]) * pleft
+ - part * (col_percent[cl] - col_percent[c])
+ > (part + 1) * (col_percent[cl] - col_percent[c])
+ - (col_percent[c + cp + 1] - col_percent[c]) * pleft)
part++;
}
part -= added;
added += part;
- span_percent [c + cp] = PERC (c + cp) + part;
+ span_percent[c + cp] = PERC (c + cp) + part;
}
}
}
@@ -1409,16 +1409,16 @@ calc_col_percentage (HTMLTable *table, gint *col_percent)
percent = g_new0 (gint, table->totalCols);
for (span = 1; next && span <= table->totalCols; span++) {
for (c = 0; c < table->totalCols; c++)
- percent [c] = 0;
+ percent[c] = 0;
next = calc_percentage_step (table, col_percent, percent, span);
add = 0;
for (c = 0; c < table->totalCols; c++) {
- col_percent [c + 1] += add;
- if (PERC (c) < percent [c]) {
- add += percent [c] - PERC (c);
- col_percent [c + 1] = col_percent [c] + percent [c];
+ col_percent[c + 1] += add;
+ if (PERC (c) < percent[c]) {
+ add += percent[c] - PERC (c);
+ col_percent[c + 1] = col_percent[c] + percent[c];
}
}
}
@@ -1432,7 +1432,7 @@ calc_not_percented (HTMLTable *table, gint *col_percent)
not_percented = 0;
for (c = 0; c < table->totalCols; c++)
- if (col_percent [c + 1] == col_percent [c])
+ if (col_percent[c + 1] == col_percent[c])
not_percented++;
return not_percented;
@@ -1446,8 +1446,8 @@ divide_into_percented (HTMLTable *table, gint *col_percent, gint *max_size, gint
to_fill = 0;
for (c = 0; c < table->totalCols; c++) {
request = (LL max_width * (PERC (c))) / 100;
- if (max_size [c] < request)
- to_fill += request - max_size [c];
+ if (max_size[c] < request)
+ to_fill += request - max_size[c];
}
/* printf ("to fill %d\n", to_fill); */
@@ -1457,15 +1457,15 @@ divide_into_percented (HTMLTable *table, gint *col_percent, gint *max_size, gint
if (left) {
for (c = 0; c < table->totalCols; c++) {
request = (LL max_width * (PERC (c))) / 100;
- if (max_size [c] < request) {
- add = LL left * (request - max_size [c] + filled) / to_fill;
- if (LL left * (request - max_size [c] + filled) - LL add * to_fill >
- LL (add + 1) * to_fill - LL left * (request - max_size [c] + filled))
+ if (max_size[c] < request) {
+ add = LL left * (request - max_size[c] + filled) / to_fill;
+ if (LL left * (request - max_size[c] + filled) - LL add * to_fill >
+ LL (add + 1) * to_fill - LL left * (request - max_size[c] + filled))
add++;
add -= added;
added += add;
- filled += request - max_size [c];
- max_size [c] += add;
+ filled += request - max_size[c];
+ max_size[c] += add;
}
}
}
@@ -1485,18 +1485,18 @@ calc_lowest_fill (HTMLTable *table, GArray *pref, gint *max_size, gint *col_perc
*ret_total_pref = 0;
*ret_total = 0;
for (c = 0; c < table->totalCols; c++)
- if (col_percent [c + 1] == col_percent [c]) {
+ if (col_percent[c + 1] == col_percent[c]) {
pw = PREF (c + 1) - PREF (c)
- pixel_size * (table->spacing + border_extra);
/* printf ("col %d pw %d size %d\n", c, pw, max_size [c]); */
- if (max_size [c] < pw) {
- if (pw - max_size [c] < min_fill) {
+ if (max_size[c] < pw) {
+ if (pw - max_size[c] < min_fill) {
*ret_col = c;
- min_fill = pw - max_size [c];
+ min_fill = pw - max_size[c];
}
(*ret_total_pref) += pw;
- (*ret_total) += max_size [c];
+ (*ret_total) += max_size[c];
}
}
@@ -1516,11 +1516,11 @@ divide_upto_preferred_width (HTMLTable *table, HTMLPainter *painter, GArray *pre
- pixel_size * (table->spacing + border_extra);
/* printf ("min: %d left: %d\n", min_col, left); */
to_divide = MIN (total_pref - total, left);
- if (min_pw - max_size [min_col] < ((gdouble) min_pw * to_divide) / total_pref) {
- added = min_pw - max_size [min_col];
+ if (min_pw - max_size[min_col] < ((gdouble) min_pw * to_divide) / total_pref) {
+ added = min_pw - max_size[min_col];
left -= added;
min_fill = to_divide - added;
- max_size [min_col] += added;
+ max_size[min_col] += added;
total_pref -= min_pw;
} else {
min_fill = to_divide;
@@ -1531,20 +1531,20 @@ divide_upto_preferred_width (HTMLTable *table, HTMLPainter *painter, GArray *pre
added = 0;
for (c = 0; c < table->totalCols; c++) {
- if (col_percent [c + 1] == col_percent [c]) {
+ if (col_percent[c + 1] == col_percent[c]) {
pw = PREF (c + 1) - PREF (c)
- pixel_size * (table->spacing + border_extra);
- if (max_size [c] < pw) {
+ if (max_size[c] < pw) {
processed_pw += pw;
part = (LL min_fill * processed_pw) / total_pref;
if (LL min_fill * processed_pw - LL part * total_pref
> LL (part + 1) * total_pref - LL min_fill * processed_pw)
part++;
part -= added;
- if (max_size [c] + part > pw)
- part = pw - max_size [c];
+ if (max_size[c] + part > pw)
+ part = pw - max_size[c];
added += part;
- max_size [c] += part;
+ max_size[c] += part;
left -= part;
/* printf ("cell %d add: %d --> %d\n", c, part, max_size [c]); */
}
@@ -1569,12 +1569,12 @@ divide_left_by_preferred_width (HTMLTable *table, HTMLPainter *painter,
#define FW(c) COLUMN_FIX (table, c + 1) - COLUMN_FIX (table, c)
pref = 0;
for (c = 0; c < table->totalCols; c++)
- if (col_percent [c + 1] == col_percent [c] && PW (c) > FW (c))
+ if (col_percent[c + 1] == col_percent[c] && PW (c) > FW (c))
pref += COLUMN_PREF (table, c + 1) - COLUMN_PREF (table, c)
- pixel_size * (table->spacing + border_extra);
/* printf ("col pref: %d size: %d\n", COLUMN_PREF (table, c + 1)
- COLUMN_PREF (table, c)
- - pixel_size * (table->spacing + border_extra), max_size [c]); */
+ - pixel_size * (table->spacing + border_extra), max_size[c]); */
added = 0;
processed_pw = 0;
@@ -1582,7 +1582,7 @@ divide_left_by_preferred_width (HTMLTable *table, HTMLPainter *painter,
if (pref)
for (c = 0; c < table->totalCols; c++) {
- if (col_percent [c + 1] == col_percent [c] && PW (c) > FW (c)) {
+ if (col_percent[c + 1] == col_percent[c] && PW (c) > FW (c)) {
pw = COLUMN_PREF (table, c + 1) - COLUMN_PREF (table, c)
- pixel_size * (table->spacing + border_extra);
processed_pw += pw;
@@ -1593,7 +1593,7 @@ divide_left_by_preferred_width (HTMLTable *table, HTMLPainter *painter,
> LL (part + 1) * pref - LL total_fill * processed_pw)
part++;
part -= added;
- max_size [c] += part;
+ max_size[c] += part;
added += part;
left -= part;
/* printf ("col %d (add %d) --> %d (pw=%d)\n", c, part, max_size [c], pw); */
@@ -1626,22 +1626,22 @@ divide_into_percented_all (HTMLTable *table, gint *col_percent, gint *max_size,
active = g_new (gboolean, table->totalCols);
for (c = 0; c < table->totalCols; c++)
- active [c] = TRUE;
+ active[c] = TRUE;
- percent = col_percent [table->totalCols];
+ percent = col_percent[table->totalCols];
width = max_width;
do {
sub_percent = 0.0;
sub_width = width;
all_active = TRUE;
for (c = 0; c < table->totalCols; c++) {
- if (active [c]) {
- if (max_size [c] < ((gdouble) width * PERC (c)) / percent)
+ if (active[c]) {
+ if (max_size[c] < ((gdouble) width * PERC (c)) / percent)
sub_percent += PERC (c);
else {
- sub_width -= max_size [c];
+ sub_width -= max_size[c];
all_active = FALSE;
- active [c] = FALSE;
+ active[c] = FALSE;
}
}
}
@@ -1651,8 +1651,8 @@ divide_into_percented_all (HTMLTable *table, gint *col_percent, gint *max_size,
/* printf ("sub_width %d\n", sub_width); */
for (c = 0; c < table->totalCols; c++)
- if (active [c] && max_size [c] < ((gdouble) width * PERC (c)) / percent)
- max_size [c] = ((gdouble) width) * (PERC (c)) / percent;
+ if (active[c] && max_size[c] < ((gdouble) width * PERC (c)) / percent)
+ max_size[c] = ((gdouble) width) * (PERC (c)) / percent;
g_free (active);
}
@@ -1671,7 +1671,7 @@ html_table_set_cells_max_width (HTMLTable *table, HTMLPainter *painter, gint *ma
for (c = 0; c < table->totalCols; c++) {
cell = table->cells[r][c];
if (cell) {
- size = max_size [c] + (cell->col != c ? size : 0);
+ size = max_size[c] + (cell->col != c ? size : 0);
if (cell_end_col (table, cell) - 1 == c && cell->row == r)
html_object_set_max_width (HTML_OBJECT (cell), painter, size
+ pixel_size * (table->spacing + border_extra) * CSPAN);
@@ -1688,7 +1688,7 @@ set_columns_optimal_width (HTMLTable *table, gint *max_size, gint pixel_size)
COLUMN_OPT (table, 0) = COLUMN_MIN (table, 0);
for (c = 0; c < table->totalCols; c++)
- COLUMN_OPT (table, c + 1) = COLUMN_OPT (table, c) + max_size [c]
+ COLUMN_OPT (table, c + 1) = COLUMN_OPT (table, c) + max_size[c]
+ pixel_size * (table->spacing + (table->border ? 2 : 0));
}
@@ -1703,7 +1703,7 @@ divide_left_width (HTMLTable *table, HTMLPainter *painter, gint *max_size, gint
col_percent = g_new (gint, table->totalCols + 1);
for (c = 0; c <= table->totalCols; c++)
- col_percent [c] = 0;
+ col_percent[c] = 0;
calc_col_percentage (table, col_percent);
/* printf ("width_left: %d percented: %d\n", width_left, col_percent [table->totalCols]); */
@@ -1729,7 +1729,7 @@ alloc_max_size (HTMLTable *table, gint pixel_size)
max_size = g_new (gint, table->totalCols);
for (c = 0; c < table->totalCols; c++)
- max_size [c] = COLUMN_MIN (table, c+1) - COLUMN_MIN (table, c) - pixel_size * (table->spacing + border_extra);
+ max_size[c] = COLUMN_MIN (table, c+1) - COLUMN_MIN (table, c) - pixel_size * (table->spacing + border_extra);
return max_size;
}
@@ -2031,7 +2031,7 @@ append_selection_string (HTMLObject *self,
/* remove last \n from added text */
if (buffer->len != len) {
tab = TRUE;
- if (buffer->str [buffer->len-1] == '\n')
+ if (buffer->str[buffer->len-1] == '\n')
g_string_truncate (buffer, buffer->len - 1);
}
}
@@ -2053,7 +2053,7 @@ head (HTMLObject *self)
for (c = 0; c < table->totalCols; c++) {
if (invalid_cell (table, r, c))
continue;
- return HTML_OBJECT (table->cells [r][c]);
+ return HTML_OBJECT (table->cells[r][c]);
}
return NULL;
}
@@ -2069,7 +2069,7 @@ tail (HTMLObject *self)
for (c = table->totalCols - 1; c >= 0; c--) {
if (invalid_cell (table, r, c))
continue;
- return HTML_OBJECT (table->cells [r][c]);
+ return HTML_OBJECT (table->cells[r][c]);
}
return NULL;
}
@@ -2087,7 +2087,7 @@ next (HTMLObject *self, HTMLObject *child)
for (; c < table->totalCols; c++) {
if (invalid_cell (table, r, c))
continue;
- return HTML_OBJECT (table->cells [r][c]);
+ return HTML_OBJECT (table->cells[r][c]);
}
c = 0;
}
@@ -2107,7 +2107,7 @@ prev (HTMLObject *self, HTMLObject *child)
for (; c >=0; c--) {
if (invalid_cell (table, r, c))
continue;
- return HTML_OBJECT (table->cells [r][c]);
+ return HTML_OBJECT (table->cells[r][c]);
}
c = table->totalCols-1;
}
@@ -2156,11 +2156,11 @@ save (HTMLObject *self,
for (r = 0; r < table->totalRows; r++) {
SB "<TR>\n" SE;
for (c = 0; c < table->totalCols; c++) {
- if (!table->cells [r][c]
- || table->cells [r][c]->row != r
- || table->cells [r][c]->col != c)
+ if (!table->cells[r][c]
+ || table->cells[r][c]->row != r
+ || table->cells[r][c]->col != c)
continue;
- if (!html_object_save (HTML_OBJECT (table->cells [r][c]), state))
+ if (!html_object_save (HTML_OBJECT (table->cells[r][c]), state))
return FALSE;
}
SB "</TR>\n" SE;
@@ -2183,12 +2183,12 @@ save_plain (HTMLObject *self,
for (r = 0; r < table->totalRows; r++) {
for (c = 0; c < table->totalCols; c++) {
- if (!table->cells [r][c]
- || table->cells [r][c]->row != r
- || table->cells [r][c]->col != c)
+ if (!table->cells[r][c]
+ || table->cells[r][c]->row != r
+ || table->cells[r][c]->col != c)
continue;
/* FIXME the width calculation for the column here is completely broken */
- result &= html_object_save_plain (HTML_OBJECT (table->cells [r][c]), state, requested_width / table->totalCols);
+ result &= html_object_save_plain (HTML_OBJECT (table->cells[r][c]), state, requested_width / table->totalCols);
}
}
@@ -2385,7 +2385,7 @@ html_table_add_cell (HTMLTable *table, HTMLTableCell *cell)
prev_col_do_cspan (table, table->row);
/* look for first free cell */
- while (table->cells [table->row][table->col] && table->col < table->totalCols)
+ while (table->cells[table->row][table->col] && table->col < table->totalCols)
table->col++;
html_table_alloc_cell (table, table->row, table->col);
@@ -2415,9 +2415,9 @@ html_table_end_table (HTMLTable *table)
for (r = 0; r < table->totalRows; r++)
for (c = 0; c < table->totalCols; c++)
- if (table->cells [r][c]) {
- if (HTML_CLUE (table->cells [r][c])->head == NULL) {
- HTMLTableCell *cell = table->cells [r][c];
+ if (table->cells[r][c]) {
+ if (HTML_CLUE (table->cells[r][c])->head == NULL) {
+ HTMLTableCell *cell = table->cells[r][c];
remove_cell (table, cell);
html_object_destroy (HTML_OBJECT (cell));
diff --git a/gtkhtml/htmltext.c b/gtkhtml/htmltext.c
index 75309e9..1624835 100644
--- a/gtkhtml/htmltext.c
+++ b/gtkhtml/htmltext.c
@@ -106,10 +106,10 @@ html_text_pango_info_destroy (HTMLTextPangoInfo *pi)
gint i;
for (i = 0; i < pi->n; i++) {
- pango_item_free (pi->entries [i].glyph_item.item);
- if (pi->entries [i].glyph_item.glyphs)
- pango_glyph_string_free (pi->entries [i].glyph_item.glyphs);
- g_free (pi->entries [i].widths);
+ pango_item_free (pi->entries[i].glyph_item.item);
+ if (pi->entries[i].glyph_item.glyphs)
+ pango_glyph_string_free (pi->entries[i].glyph_item.glyphs);
+ g_free (pi->entries[i].widths);
}
g_free (pi->entries);
g_free (pi->attrs);
@@ -405,7 +405,7 @@ html_text_op_cut_helper (HTMLText *text, HTMLEngine *e, GList *from, GList *to,
begin_index = html_text_get_index (text, begin);
end_index = tail - text->text;
text->text_bytes -= tail - (text->text + begin_index);
- text->text [begin_index] = 0;
+ text->text[begin_index] = 0;
cut_attr_list (text, begin_index, end_index);
if (end_index < rvt->text_bytes)
cut_attr_list (rvt, end_index, rvt->text_bytes);
@@ -851,8 +851,8 @@ html_text_get_item_index (HTMLText *text, HTMLPainter *painter, gint offset, gin
gint idx = 0;
if (pi->n > 0) {
- while (idx < pi->n - 1 && offset >= pi->entries [idx].glyph_item.item->num_chars) {
- offset -= pi->entries [idx].glyph_item.item->num_chars;
+ while (idx < pi->n - 1 && offset >= pi->entries[idx].glyph_item.item->num_chars) {
+ offset -= pi->entries[idx].glyph_item.item->num_chars;
idx++;
}
@@ -975,28 +975,28 @@ html_text_calc_part_width (HTMLText *text, HTMLPainter *painter, gchar *start, g
idx = html_text_get_item_index (text, painter, offset, &offset);
if (need_ascent_descent) {
- update_asc_dsc (painter, pi->entries [idx].glyph_item.item, &ascent, &descent);
- font = pi->entries [idx].glyph_item.item->analysis.font;
- language = pi->entries [idx].glyph_item.item->analysis.language;
+ update_asc_dsc (painter, pi->entries[idx].glyph_item.item, &ascent, &descent);
+ font = pi->entries[idx].glyph_item.item->analysis.font;
+ language = pi->entries[idx].glyph_item.item->analysis.language;
}
while (len > 0) {
gint old_idx;
if (*s == '\t') {
gint skip = 8 - (line_offset % 8);
- width += skip*pi->entries [idx].widths [offset];
+ width += skip*pi->entries[idx].widths[offset];
line_offset += skip;
} else {
- width += pi->entries [idx].widths [offset];
+ width += pi->entries[idx].widths[offset];
line_offset++;
}
len--;
old_idx = idx;
if (html_text_pi_forward (pi, &idx, &offset) && idx != old_idx)
- if (len > 0 && (need_ascent_descent) && (pi->entries [idx].glyph_item.item->analysis.font != font
- || pi->entries [idx].glyph_item.item->analysis.language != language)) {
- update_asc_dsc (painter, pi->entries [idx].glyph_item.item, &ascent, &descent);
+ if (len > 0 && (need_ascent_descent) && (pi->entries[idx].glyph_item.item->analysis.font != font
+ || pi->entries[idx].glyph_item.item->analysis.language != language)) {
+ update_asc_dsc (painter, pi->entries[idx].glyph_item.item, &ascent, &descent);
}
s = g_utf8_next_char (s);
@@ -1138,7 +1138,7 @@ min_word_width_calc_tabs (HTMLText *text, HTMLPainter *p, gint idx, gint *len)
gint
html_text_pango_info_get_index (HTMLTextPangoInfo *pi, gint byte_offset, gint idx)
{
- while (idx < pi->n && pi->entries [idx].glyph_item.item->offset + pi->entries [idx].glyph_item.item->length <= byte_offset)
+ while (idx < pi->n && pi->entries[idx].glyph_item.item->offset + pi->entries[idx].glyph_item.item->length <= byte_offset)
idx++;
return idx;
@@ -1168,7 +1168,7 @@ html_text_remove_unwanted_line_breaks (gchar *s, gint len, PangoLogAttr *attrs)
for (i = 0; i < len; i++) {
gunichar uc = g_utf8_get_char (s);
- if (attrs [i].is_line_break) {
+ if (attrs[i].is_line_break) {
if (last_uc == '.' || last_uc == '/' ||
last_uc == '-' || last_uc == '$' ||
last_uc == '+' || last_uc == '?' ||
@@ -1176,14 +1176,14 @@ html_text_remove_unwanted_line_breaks (gchar *s, gint len, PangoLogAttr *attrs)
last_uc == '}' ||
last_uc == ']' ||
last_uc == '>')
- attrs [i].is_line_break = 0;
+ attrs[i].is_line_break = 0;
else if ((uc == '(' ||
uc == '{' ||
uc == '[' ||
uc == '<'
)
- && i > 0 && !attrs [i - 1].is_white)
- attrs [i].is_line_break = 0;
+ && i > 0 && !attrs[i - 1].is_white)
+ attrs[i].is_line_break = 0;
}
s = g_utf8_next_char (s);
last_uc = uc;
@@ -1436,24 +1436,24 @@ html_text_get_pango_info (HTMLText *text, HTMLPainter *painter)
html_text_remove_unwanted_line_breaks (text->text, text->text_len, text->pi->attrs);
for (i = 0, cur = items; i < text->pi->n; i++, cur = cur->next)
- text->pi->entries [i].glyph_item.item = (PangoItem *) cur->data;
+ text->pi->entries[i].glyph_item.item = (PangoItem *) cur->data;
for (i = 0; i < text->pi->n; i++) {
PangoItem *item;
PangoGlyphString *glyphs;
- item = text->pi->entries [i].glyph_item.item;
- glyphs = text->pi->entries [i].glyph_item.glyphs = pango_glyph_string_new ();
+ item = text->pi->entries[i].glyph_item.item;
+ glyphs = text->pi->entries[i].glyph_item.glyphs = pango_glyph_string_new ();
/* printf ("item pos %d len %d\n", item->offset, item->length); */
- text->pi->entries [i].widths = g_new (PangoGlyphUnit, item->num_chars);
- if (text->text [item->offset] == '\t')
+ text->pi->entries[i].widths = g_new (PangoGlyphUnit, item->num_chars);
+ if (text->text[item->offset] == '\t')
html_text_shape_tab (text, glyphs);
else
pango_shape (text->text + item->offset, item->length, &item->analysis, glyphs);
html_tmp_fix_pango_glyph_string_get_logical_widths (glyphs, text->text + item->offset, item->length,
- item->analysis.level, text->pi->entries [i].widths);
+ item->analysis.level, text->pi->entries[i].widths);
}
g_list_free (items);
@@ -1478,7 +1478,7 @@ html_text_pi_backward (HTMLTextPangoInfo *pi, gint *ii, gint *io)
gboolean
html_text_pi_forward (HTMLTextPangoInfo *pi, gint *ii, gint *io)
{
- if (*io >= pi->entries [*ii].glyph_item.item->num_chars - 1) {
+ if (*io >= pi->entries[*ii].glyph_item.item->num_chars - 1) {
if (*ii >= pi->n -1)
return FALSE;
(*ii) ++;
@@ -1514,7 +1514,7 @@ html_text_tail_white_space (HTMLText *text, HTMLPainter *painter, gint offset, g
if (html_text_pi_backward (pi, &ii, &io)) {
s = g_utf8_prev_char (s);
offset--;
- if (pi->attrs [offset].is_white) {
+ if (pi->attrs[offset].is_white) {
if (*s == '\t' && offset > 1) {
gint skip = 8, co = offset - 1;
@@ -1525,9 +1525,9 @@ html_text_tail_white_space (HTMLText *text, HTMLPainter *painter, gint offset, g
skip--;
} while (s && co > 0 && *s != '\t');
- ww += skip*pi->entries [ii].widths [io];
+ ww += skip*pi->entries[ii].widths[io];
} else {
- ww += pi->entries [ii].widths [io];
+ ww += pi->entries[ii].widths[io];
}
wl++;
}
@@ -1571,15 +1571,15 @@ calc_min_width (HTMLObject *self, HTMLPainter *painter)
line_offset = html_text_get_line_offset (text, painter, 0);
s = text->text;
while (offset < text->text_len) {
- if (offset > 0 && html_text_is_line_break (pi->attrs [offset]))
+ if (offset > 0 && html_text_is_line_break (pi->attrs[offset]))
update_mw (text, painter, offset, &last_offset, &ww, &mw, ii, io, s, line_offset);
if (*s == '\t') {
gint skip = 8 - (line_offset % 8);
- ww += skip*pi->entries [ii].widths [io];
+ ww += skip*pi->entries[ii].widths[io];
line_offset += skip;
} else {
- ww += pi->entries [ii].widths [io];
+ ww += pi->entries[ii].widths[io];
line_offset++;
}
@@ -2339,12 +2339,12 @@ select_range (HTMLObject *self,
length = HTML_TEXT (self)->text_len - offset;
/* extend to cursor positions */
- while (offset > 0 && !pi->attrs [offset].is_cursor_position) {
+ while (offset > 0 && !pi->attrs[offset].is_cursor_position) {
offset--;
length++;
}
- while (offset + length < text->text_len && !pi->attrs [offset + length].is_cursor_position)
+ while (offset + length < text->text_len && !pi->attrs[offset + length].is_cursor_position)
length++;
/* printf ("updated offset: %d length: %d (end offset %d)\n", offset, length, offset + length); */
@@ -3166,7 +3166,7 @@ struct _HTMLMagicInsertMatch
typedef struct _HTMLMagicInsertMatch HTMLMagicInsertMatch;
-static HTMLMagicInsertMatch mim [] = {
+static HTMLMagicInsertMatch mim[] = {
/* prefixed expressions */
{ "(news|telnet|nntp|file|http|ftp|sftp|https|webcal)://([-a-z0-9]+(:[-a-z0-9]+)?@)?[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(([.])?/[-a-z0-9_$.+!*(),;:@%&=?/~#']*[^]'.}>\\) ,?!;:\"]?)?", NULL, NULL },
{ "(sip|h323|callto):([-_a-z0-9.'\\+]+(:[0-9]{1,5})?(/[-_a-z0-9.']+)?)(@([-_a-z0-9.%=?]+|([0-9]{1,3}.){3}[0-9]{1,3})?)?(:[0-9]{1,5})?", NULL, NULL },
@@ -3183,11 +3183,11 @@ html_engine_init_magic_links (void)
gint i;
for (i = 0; i < G_N_ELEMENTS (mim); i++) {
- mim [i].preg = g_new0 (regex_t, 1);
- if (regcomp (mim [i].preg, mim [i].regex, REG_EXTENDED | REG_ICASE)) {
+ mim[i].preg = g_new0 (regex_t, 1);
+ if (regcomp (mim[i].preg, mim[i].regex, REG_EXTENDED | REG_ICASE)) {
/* error */
- g_free (mim [i].preg);
- mim [i].preg = 0;
+ g_free (mim[i].preg);
+ mim[i].preg = 0;
}
}
}
@@ -3209,7 +3209,7 @@ paste_link (HTMLEngine *engine, HTMLText *text, gint so, gint eo, const gchar *p
gboolean
html_text_magic_link (HTMLText *text, HTMLEngine *engine, guint offset)
{
- regmatch_t pmatch [2];
+ regmatch_t pmatch[2];
gint i;
gboolean rv = FALSE, exec = TRUE;
gint saved_position;
@@ -3262,12 +3262,12 @@ html_text_magic_link (HTMLText *text, HTMLEngine *engine, guint offset)
while (!done) {
done = TRUE;
for (i = 0; i < G_N_ELEMENTS (mim); i++) {
- if (mim [i].preg && !regexec (mim [i].preg, str + str_offset, 2, pmatch, 0)) {
+ if (mim[i].preg && !regexec (mim[i].preg, str + str_offset, 2, pmatch, 0)) {
paste_link (engine, text,
- g_utf8_pointer_to_offset (text->text, str + str_offset + pmatch [0].rm_so),
- g_utf8_pointer_to_offset (text->text, str + str_offset + pmatch [0].rm_eo), mim [i].prefix);
+ g_utf8_pointer_to_offset (text->text, str + str_offset + pmatch[0].rm_so),
+ g_utf8_pointer_to_offset (text->text, str + str_offset + pmatch[0].rm_eo), mim[i].prefix);
rv = TRUE;
- str_offset += pmatch [0].rm_eo + 1;
+ str_offset += pmatch[0].rm_eo + 1;
done = str_offset >= str_length;
break;
}
diff --git a/gtkhtml/htmltextslave.c b/gtkhtml/htmltextslave.c
index 7c075ff..395efe1 100644
--- a/gtkhtml/htmltextslave.c
+++ b/gtkhtml/htmltextslave.c
@@ -261,7 +261,7 @@ debug_print (HTMLFitType rv, gchar *text, gint len)
}
for (i = 0; i < len; i++)
- putchar (text [i]);
+ putchar (text[i]);
printf ("'\n");
}
@@ -398,11 +398,11 @@ hts_fit_line (HTMLObject *o, HTMLPainter *painter,
lbsp = s = html_text_slave_get_text (slave);
while ((force_fit || widthLeft > lbw) && offset < slave->posStart + slave->posLen) {
- if (offset > slave->posStart && offset > lbo && html_text_is_line_break (pi->attrs [offset]))
+ if (offset > slave->posStart && offset > lbo && html_text_is_line_break (pi->attrs[offset]))
if (update_lb (slave, painter, widthLeft, offset, s, ii, io, line_offset, w, &lwl, &lbw, &lbo, &lbsp, &force_fit))
break;
- if (io == 0 && slave->owner->text [pi->entries [ii].glyph_item.item->offset] == '\t') {
+ if (io == 0 && slave->owner->text[pi->entries[ii].glyph_item.item->offset] == '\t') {
GtkHTMLFontStyle font_style;
gchar *face;
gint skip = 8 - (line_offset % 8);
@@ -415,13 +415,13 @@ hts_fit_line (HTMLObject *o, HTMLPainter *painter,
face = slave->owner->face;
}
- pi->entries [ii].glyph_item.glyphs->glyphs[0].geometry.width = pi->entries [ii].widths [io]
+ pi->entries[ii].glyph_item.glyphs->glyphs[0].geometry.width = pi->entries[ii].widths[io]
= skip*html_painter_get_space_width (painter, font_style, face) * PANGO_SCALE;
line_offset += skip;
} else {
line_offset++;
}
- w += pi->entries [ii].widths [io];
+ w += pi->entries[ii].widths[io];
html_text_pi_forward (pi, &ii, &io);
s = g_utf8_next_char (s);
@@ -578,7 +578,7 @@ get_glyph_items_in_range (HTMLTextSlave *slave, HTMLPainter *painter, gint start
end_offset = start_offset + len;
for (offset = 0, i = 0; i < pi->n; i++) {
- PangoItem *item = pi->entries [i].glyph_item.item;
+ PangoItem *item = pi->entries[i].glyph_item.item;
/* do item and slave overlap? */
if (MAX (offset, start_offset) < MIN (offset + item->num_chars, end_offset)) {
@@ -586,8 +586,8 @@ get_glyph_items_in_range (HTMLTextSlave *slave, HTMLPainter *painter, gint start
/* use text glyph item */
glyph_item->type = HTML_TEXT_SLAVE_GLYPH_ITEM_PARENTAL;
- glyph_item->glyph_item = pi->entries [i].glyph_item;
- glyph_item->widths = pi->entries [i].widths;
+ glyph_item->glyph_item = pi->entries[i].glyph_item;
+ glyph_item->widths = pi->entries[i].widths;
if (start_offset > offset) {
/* need to cut the beginning of current glyph item */
@@ -976,18 +976,18 @@ calc_offset (HTMLTextSlave *slave, HTMLPainter *painter, gint x)
if (item->analysis.level % 2 == 0) {
/* LTR */
for (i = 0; i < item->num_chars; i++) {
- if (x < html_painter_pango_to_engine (painter, width + gi->widths [i] / 2))
+ if (x < html_painter_pango_to_engine (painter, width + gi->widths[i] / 2))
goto done;
- width += gi->widths [i];
+ width += gi->widths[i];
}
} else {
/* RTL */
for (i = item->num_chars - 1; i >= 0; i--) {
- if (x < html_painter_pango_to_engine (painter, width + gi->widths [i] / 2)) {
+ if (x < html_painter_pango_to_engine (painter, width + gi->widths[i] / 2)) {
i++;
goto done;
}
- width += gi->widths [i];
+ width += gi->widths[i];
}
}
}
@@ -1305,7 +1305,7 @@ html_text_slave_cursor_right (HTMLTextSlave *slave, HTMLPainter *painter, HTMLCu
do
step_success = html_text_slave_cursor_right_one (slave, painter, cursor);
- while (step_success && !pi->attrs [cursor->offset].is_cursor_position);
+ while (step_success && !pi->attrs[cursor->offset].is_cursor_position);
return step_success;
}
@@ -1370,7 +1370,7 @@ html_text_slave_cursor_left (HTMLTextSlave *slave, HTMLPainter *painter, HTMLCur
do
step_success = html_text_slave_cursor_left_one (slave, painter, cursor);
- while (step_success && !pi->attrs [cursor->offset].is_cursor_position);
+ while (step_success && !pi->attrs[cursor->offset].is_cursor_position);
return step_success;
}
@@ -1384,7 +1384,7 @@ html_text_slave_get_left_edge (HTMLTextSlave *slave, HTMLPainter *painter, HTMLC
cursor->offset = html_text_slave_get_left_edge_offset (slave, painter);
- if (pi->attrs [cursor->offset].is_cursor_position && old_offset != cursor->offset)
+ if (pi->attrs[cursor->offset].is_cursor_position && old_offset != cursor->offset)
return TRUE;
else {
if (html_text_slave_cursor_right (slave, painter, cursor)) {
@@ -1405,7 +1405,7 @@ html_text_slave_get_right_edge (HTMLTextSlave *slave, HTMLPainter *painter, HTML
cursor->offset = html_text_slave_get_right_edge_offset (slave, painter);
- if (pi->attrs [cursor->offset].is_cursor_position && old_offset != cursor->offset)
+ if (pi->attrs[cursor->offset].is_cursor_position && old_offset != cursor->offset)
return TRUE;
else {
if (html_text_slave_cursor_left (slave, painter, cursor)) {
diff --git a/gtkhtml/htmltokenizer.c b/gtkhtml/htmltokenizer.c
index f1551c6..95975ba 100644
--- a/gtkhtml/htmltokenizer.c
+++ b/gtkhtml/htmltokenizer.c
@@ -215,7 +215,7 @@ html_tokenizer_class_init (HTMLTokenizerClass *klass)
G_TYPE_NONE,
1, G_TYPE_POINTER);
- html_tokenizer_signals [HTML_TOKENIZER_END_SIGNAL] =
+ html_tokenizer_signals[HTML_TOKENIZER_END_SIGNAL] =
g_signal_new ("end",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
@@ -365,7 +365,7 @@ html_token_buffer_append_token (HTMLTokenBuffer * buf, const gchar *token, gint
/* copy token and terminate with zero */
strncpy (buf->data + buf->used, token, len);
buf->used += len;
- buf->data [buf->used] = 0;
+ buf->data[buf->used] = 0;
buf->used++;
dt(printf ("html_token_buffer_append_token: '%s'\n", buf->data + buf->used - 1 - len));
@@ -955,7 +955,7 @@ in_comment (HTMLTokenizer *t, const gchar **src)
p->searchCount++;
} else if (p->searchCount == 2 && (**src == '>')) {
p->comment = FALSE; /* We've got a "-->" sequence */
- } else if (tolower (**src) == gtkhtmlStart [p->searchGtkHTMLCount]) {
+ } else if (tolower (**src) == gtkhtmlStart[p->searchGtkHTMLCount]) {
if (p->searchGtkHTMLCount == 8) {
p->extension = TRUE;
p->comment = FALSE;
@@ -1020,10 +1020,10 @@ in_script_or_style (HTMLTokenizer *t, const gchar **src)
if (p->scriptCodeSize + 11 > p->scriptCodeMaxSize)
p->scriptCode = g_realloc (p->scriptCode, p->scriptCodeMaxSize += 1024);
- if ((**src == '>' ) && ( p->searchFor [p->searchCount] == '>')) {
+ if ((**src == '>' ) && ( p->searchFor[p->searchCount] == '>')) {
(*src)++;
- p->scriptCode [p->scriptCodeSize] = 0;
- p->scriptCode [p->scriptCodeSize + 1] = 0;
+ p->scriptCode[p->scriptCodeSize] = 0;
+ p->scriptCode[p->scriptCodeSize + 1] = 0;
if (p->script) {
p->script = FALSE;
}
@@ -1036,12 +1036,12 @@ in_script_or_style (HTMLTokenizer *t, const gchar **src)
/* Check if a </script> tag is on its way */
else if (p->searchCount > 0) {
gboolean put_to_script = FALSE;
- if (tolower (**src) == p->searchFor [p->searchCount]) {
- p->searchBuffer [p->searchCount] = **src;
+ if (tolower (**src) == p->searchFor[p->searchCount]) {
+ p->searchBuffer[p->searchCount] = **src;
p->searchCount++;
(*src)++;
}
- else if (p->searchFor [p->searchCount] == '>') {
+ else if (p->searchFor[p->searchCount] == '>') {
/* There can be any number of white-space characters between
tag name and closing '>' so try to move through them, if possible */
@@ -1060,21 +1060,21 @@ in_script_or_style (HTMLTokenizer *t, const gchar **src)
if (put_to_script) {
gchar *c;
- p->searchBuffer [p->searchCount] = 0;
+ p->searchBuffer[p->searchCount] = 0;
c = p->searchBuffer;
while (*c)
- p->scriptCode [p->scriptCodeSize++] = *c++;
- p->scriptCode [p->scriptCodeSize] = **src; (*src)++;
+ p->scriptCode[p->scriptCodeSize++] = *c++;
+ p->scriptCode[p->scriptCodeSize] = **src; (*src)++;
p->searchCount = 0;
}
}
else if (**src == '<') {
p->searchCount = 1;
- p->searchBuffer [0] = '<';
+ p->searchBuffer[0] = '<';
(*src)++;
}
else {
- p->scriptCode [p->scriptCodeSize] = **src;
+ p->scriptCode[p->scriptCodeSize] = **src;
(*src)++;
}
}
@@ -1468,7 +1468,7 @@ html_tokenizer_begin (HTMLTokenizer *t, const gchar *content_type)
g_return_if_fail (t && HTML_IS_TOKENIZER (t));
- g_signal_emit (t, html_tokenizer_signals [HTML_TOKENIZER_BEGIN_SIGNAL], 0, content_type);
+ g_signal_emit (t, html_tokenizer_signals[HTML_TOKENIZER_BEGIN_SIGNAL], 0, content_type);
}
void
@@ -1476,7 +1476,7 @@ html_tokenizer_set_engine_type (HTMLTokenizer *t, gboolean engine_type)
{
g_return_if_fail (t && HTML_IS_TOKENIZER (t));
- g_signal_emit (t, html_tokenizer_signals [HTML_TOKENIZER_CHANGEENGINE_SIGNAL], 0, engine_type);
+ g_signal_emit (t, html_tokenizer_signals[HTML_TOKENIZER_CHANGEENGINE_SIGNAL], 0, engine_type);
}
void
@@ -1484,7 +1484,7 @@ html_tokenizer_change_content_type (HTMLTokenizer *t,const gchar *content_type)
{
g_return_if_fail (t && HTML_IS_TOKENIZER (t));
- g_signal_emit (t, html_tokenizer_signals [HTML_TOKENIZER_CHANGECONTENT_SIGNAL], 0, content_type);
+ g_signal_emit (t, html_tokenizer_signals[HTML_TOKENIZER_CHANGECONTENT_SIGNAL], 0, content_type);
}
void
diff --git a/gtkhtml/htmlundo.c b/gtkhtml/htmlundo.c
index 8540ac4..891f70d 100644
--- a/gtkhtml/htmlundo.c
+++ b/gtkhtml/htmlundo.c
@@ -356,7 +356,7 @@ struct _HTMLUndoLevel {
HTMLUndo *parent_undo;
HTMLUndoStack stack;
- gchar *description [HTML_UNDO_END];
+ gchar *description[HTML_UNDO_END];
};
typedef struct _HTMLUndoLevel HTMLUndoLevel;
@@ -376,8 +376,8 @@ level_destroy (HTMLUndoData *data)
destroy_action_list (level->stack.stack);
g_list_free (level->stack.stack);
- g_free (level->description [HTML_UNDO_UNDO]);
- g_free (level->description [HTML_UNDO_REDO]);
+ g_free (level->description[HTML_UNDO_UNDO]);
+ g_free (level->description[HTML_UNDO_REDO]);
}
static HTMLUndoLevel *
@@ -391,8 +391,8 @@ level_new (HTMLUndo *undo, HTMLUndoStack *stack, const gchar *undo_description,
nl->data.destroy = level_destroy;
nl->parent_undo = undo;
- nl->description [HTML_UNDO_UNDO] = g_strdup (undo_description);
- nl->description [HTML_UNDO_REDO] = g_strdup (redo_description);
+ nl->description[HTML_UNDO_UNDO] = g_strdup (undo_description);
+ nl->description[HTML_UNDO_REDO] = g_strdup (redo_description);
return nl;
}
@@ -491,7 +491,7 @@ html_undo_level_end (HTMLUndo *undo, HTMLEngine *engine)
HTMLUndoAction *action;
/* we use position from last undo action on the stack */
- action = html_undo_action_new (level->description [HTML_UNDO_UNDO],
+ action = html_undo_action_new (level->description[HTML_UNDO_UNDO],
undo_step_action,
HTML_UNDO_DATA (level),
HTML_UNDO_ACTION (save_undo.stack->data)->position,
@@ -522,9 +522,9 @@ undo_step_action (HTMLEngine *e, HTMLUndoData *data, HTMLUndoDirection dir, guin
/* prepare undo/redo step */
if (dir == HTML_UNDO_UNDO)
- redo_level_begin (undo, level->description [HTML_UNDO_REDO], level->description [HTML_UNDO_UNDO]);
+ redo_level_begin (undo, level->description[HTML_UNDO_REDO], level->description[HTML_UNDO_UNDO]);
else
- html_undo_level_begin (undo, level->description [HTML_UNDO_UNDO], level->description [HTML_UNDO_REDO]);
+ html_undo_level_begin (undo, level->description[HTML_UNDO_UNDO], level->description[HTML_UNDO_REDO]);
/* preserve current undo/redo stack */
stack_copy (stack, &save);
diff --git a/gtkhtml/htmlurl.c b/gtkhtml/htmlurl.c
index 23a5d89..d8e624f 100644
--- a/gtkhtml/htmlurl.c
+++ b/gtkhtml/htmlurl.c
@@ -473,7 +473,7 @@ concat_dir_and_file (const gchar *dir, const gchar *file)
{
/* If the directory name doesn't have a / on the end, we need
to add one so we get a proper path to the file */
- if (*dir && dir [strlen(dir) - 1] != PATH_SEP)
+ if (*dir && dir[strlen(dir) - 1] != PATH_SEP)
return g_strconcat (dir, PATH_SEP_STR, file, NULL);
else
return g_strconcat (dir, file, NULL);
diff --git a/gtkhtml/test-stress.c b/gtkhtml/test-stress.c
index 5e8d4c0..fb4d7f6 100644
--- a/gtkhtml/test-stress.c
+++ b/gtkhtml/test-stress.c
@@ -87,12 +87,12 @@ static gint test_level_1 (GtkHTML *html)
for (i = 0; i < 200; i++) {
gint j, len = 1 + (gint) (10.0*rand()/(RAND_MAX+1.0));
- gchar word [12];
+ gchar word[12];
for (j = 0; j < len; j++)
- word [j] = 'a' + (gint) (26.0*rand()/(RAND_MAX+1.0));
- word [len] = ' ';
- word [len + 1] = 0;
+ word[j] = 'a' + (gint) (26.0*rand()/(RAND_MAX+1.0));
+ word[len] = ' ';
+ word[len + 1] = 0;
total_len += len + 1;
html_engine_insert_text (html->engine, word, -1);
@@ -135,13 +135,13 @@ static gint test_level_1 (GtkHTML *html)
if (et == 0)
gtk_html_command (html, "insert-tab");
else {
- gchar ch [2];
+ gchar ch[2];
if (et == 1)
- ch [0] = ' ';
+ ch[0] = ' ';
else
- ch [0] = 'a' + (gint) (26.0*rand()/(RAND_MAX+1.0));
- ch [1] = 0;
+ ch[0] = 'a' + (gint) (26.0*rand()/(RAND_MAX+1.0));
+ ch[1] = 0;
html_engine_insert_text (html->engine, ch, 1);
}
}
@@ -254,14 +254,14 @@ gint main (gint argc, gchar *argv[])
fprintf (stderr, "\nGtkHTML test suite\n");
fprintf (stderr, "--------------------------------------------------------------------------------\n");
- for (i = 0; tests [i].name; i++) {
+ for (i = 0; tests[i].name; i++) {
gint j, result;
- if (tests [i].test_function) {
+ if (tests[i].test_function) {
fprintf (stderr, " %s ", tests [i].name);
- for (j = strlen (tests [i].name); j < 69; j++)
+ for (j = strlen (tests[i].name); j < 69; j++)
fputc ('.', stderr);
- result = (*tests [i].test_function) (html);
+ result = (*tests[i].test_function) (html);
fprintf (stderr, " %s\n", result ? "passed" : "failed");
n_all++;
diff --git a/gtkhtml/test-suite.c b/gtkhtml/test-suite.c
index f2f5f31..a3528da 100644
--- a/gtkhtml/test-suite.c
+++ b/gtkhtml/test-suite.c
@@ -542,7 +542,7 @@ test_quotes_in_div_block (GtkHTML *html)
flow_levels = HTML_CLUEFLOW (HTML_CLUE (HTML_CLUE (e->clue)->head)->head)->levels;
/* test if levels are OK */
- if (!flow_levels || !flow_levels->len == 1 || flow_levels->data [0] != HTML_LIST_TYPE_BLOCKQUOTE_CITE)
+ if (!flow_levels || !flow_levels->len == 1 || flow_levels->data[0] != HTML_LIST_TYPE_BLOCKQUOTE_CITE)
return FALSE;
return TRUE;
@@ -571,11 +571,11 @@ test_quotes_in_table (GtkHTML *html)
table = HTML_TABLE (HTML_CLUE (HTML_CLUE (e->clue)->head->next)->head);
- if (table->totalCols != 1 || table->totalRows != 1 || !table->cells [0][0] || !HTML_IS_TABLE_CELL (table->cells [0][0])
- || !HTML_CLUE (table->cells [0][0])->head || !HTML_IS_CLUEFLOW (HTML_CLUE (table->cells [0][0])->head))
+ if (table->totalCols != 1 || table->totalRows != 1 || !table->cells[0][0] || !HTML_IS_TABLE_CELL (table->cells[0][0])
+ || !HTML_CLUE (table->cells[0][0])->head || !HTML_IS_CLUEFLOW (HTML_CLUE (table->cells[0][0])->head))
return FALSE;
- flow_levels = HTML_CLUEFLOW (HTML_CLUE (table->cells [0][0])->head)->levels;
+ flow_levels = HTML_CLUEFLOW (HTML_CLUE (table->cells[0][0])->head)->levels;
/* test if levels are OK */
if (!flow_levels || !flow_levels->len == 0)
@@ -748,14 +748,14 @@ gint main (gint argc, gchar *argv[])
fprintf (stderr, "\nGtkHTML test suite\n");
fprintf (stderr, "--------------------------------------------------------------------------------\n");
- for (i = 0; tests [i].name; i++) {
+ for (i = 0; tests[i].name; i++) {
gint j, result;
- if (tests [i].test_function) {
+ if (tests[i].test_function) {
fprintf (stderr, " %s ", tests [i].name);
- for (j = strlen (tests [i].name); j < 69; j++)
+ for (j = strlen (tests[i].name); j < 69; j++)
fputc ('.', stderr);
- result = (*tests [i].test_function) (html);
+ result = (*tests[i].test_function) (html);
fprintf (stderr, " %s\n", result ? "passed" : "failed");
n_all++;
diff --git a/gtkhtml/testgtkhtml.c b/gtkhtml/testgtkhtml.c
index 0b70085..1334379 100644
--- a/gtkhtml/testgtkhtml.c
+++ b/gtkhtml/testgtkhtml.c
@@ -1319,8 +1319,8 @@ main (gint argc, gchar *argv[])
soup_session_add_feature (session, SOUP_SESSION_FEATURE (cookie_jar));
#endif
- if (argc > 1 && *argv [argc - 1] != '-')
- goto_url (argv [argc - 1], 0);
+ if (argc > 1 && *argv[argc - 1] != '-')
+ goto_url (argv[argc - 1], 0);
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]