[gtksourceview] Remove all trailspaces in *.c and *.h files
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Remove all trailspaces in *.c and *.h files
- Date: Sun, 8 Apr 2012 13:32:52 +0000 (UTC)
commit 9c48fa40269e31e45d9587e0062d46a51386e0a0
Author: SÃbastien Wilmet <sebastien wilmet gmail com>
Date: Sun Apr 8 15:18:14 2012 +0200
Remove all trailspaces in *.c and *.h files
The command used:
$ for i in *.{c,h}; do sed -i 's/[[:space:]]*$//' $i; done
gtksourceview/gtksource.h | 6 +-
gtksourceview/gtksourcebuffer.c | 4 +-
gtksourceview/gtksourcebuffer.h | 4 +-
gtksourceview/gtksourcecompletion.h | 2 +-
gtksourceview/gtksourcecompletioncontext.c | 8 +-
gtksourceview/gtksourcecompletionitem.c | 58 +-
gtksourceview/gtksourcecompletionitem.h | 2 +-
gtksourceview/gtksourcecompletionmodel.c | 252 +++++-----
gtksourceview/gtksourcecompletionmodel.h | 6 +-
gtksourceview/gtksourcecompletionproposal.c | 26 +-
gtksourceview/gtksourcecompletionproposal.h | 8 +-
gtksourceview/gtksourcecompletionprovider.c | 26 +-
gtksourceview/gtksourcecompletionprovider.h | 2 +-
gtksourceview/gtksourcecompletionutils.c | 62 +-
gtksourceview/gtksourcecompletionutils.h | 8 +-
gtksourceview/gtksourcecontextengine.c | 2 +-
gtksourceview/gtksourcegutter.c | 2 +-
gtksourceview/gtksourcegutterrenderer.c | 4 +-
gtksourceview/gtksourcegutterrendererlines.c | 4 +-
gtksourceview/gtksourcegutterrenderermarks.c | 4 +-
gtksourceview/gtksourcegutterrendererpixbuf.h | 2 +-
gtksourceview/gtksourcegutterrenderertext.h | 2 +-
gtksourceview/gtksourcelanguage.c | 2 +-
gtksourceview/gtksourcelanguagemanager.c | 28 +-
gtksourceview/gtksourcemark.c | 14 +-
gtksourceview/gtksourcemark.h | 2 +-
gtksourceview/gtksourceprintcompositor.c | 730 ++++++++++++------------
gtksourceview/gtksourceprintcompositor.h | 18 +-
gtksourceview/gtksourcestylescheme.c | 2 +-
gtksourceview/gtksourceundomanager.c | 4 +-
gtksourceview/gtksourceundomanagerdefault.c | 4 +-
gtksourceview/gtksourceview.h | 2 +-
tests/test-completion.c | 34 +-
tests/test-widget.c | 4 +-
tests/testregion.c | 12 +-
35 files changed, 675 insertions(+), 675 deletions(-)
---
diff --git a/gtksourceview/gtksource.h b/gtksourceview/gtksource.h
index 911fb50..507e0bf 100644
--- a/gtksourceview/gtksource.h
+++ b/gtksourceview/gtksource.h
@@ -1,17 +1,17 @@
/*
* gtksource.h
- * This file is part of gtksourceview
+ * This file is part of gtksourceview
*
* gtksourceview is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* gtksourceview is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/gtksourceview/gtksourcebuffer.c b/gtksourceview/gtksourcebuffer.c
index 00babe5..306664b 100644
--- a/gtksourceview/gtksourcebuffer.c
+++ b/gtksourceview/gtksourcebuffer.c
@@ -828,7 +828,7 @@ gtk_source_buffer_move_cursor (GtkTextBuffer *buffer,
applied to the buffer. See apply_tag_real for more
information */
source_buffer->priv->allow_bracket_match = TRUE;
-
+
/* Mark matching bracket */
if (!source_buffer->priv->bracket_mark_match)
{
@@ -2062,7 +2062,7 @@ gtk_source_buffer_get_source_marks_at_iter (GtkSourceBuffer *buffer,
const gchar *category)
{
GSList *marks, *l, *res;
-
+
g_return_val_if_fail (iter != NULL, NULL);
res = NULL;
diff --git a/gtksourceview/gtksourcebuffer.h b/gtksourceview/gtksourcebuffer.h
index 1b9dedd..136a35a 100644
--- a/gtksourceview/gtksourcebuffer.h
+++ b/gtksourceview/gtksourcebuffer.h
@@ -186,10 +186,10 @@ void _gtk_source_buffer_update_highlight (GtkSourceBuffer *buffer,
gboolean synchronous);
GtkSourceMark *_gtk_source_buffer_source_mark_next (GtkSourceBuffer *buffer,
- GtkSourceMark *mark,
+ GtkSourceMark *mark,
const gchar *category);
GtkSourceMark *_gtk_source_buffer_source_mark_prev (GtkSourceBuffer *buffer,
- GtkSourceMark *mark,
+ GtkSourceMark *mark,
const gchar *category);
GtkTextTag *_gtk_source_buffer_get_bracket_match_tag (GtkSourceBuffer *buffer);
diff --git a/gtksourceview/gtksourcecompletion.h b/gtksourceview/gtksourcecompletion.h
index 6bfac12..a3aded7 100644
--- a/gtksourceview/gtksourcecompletion.h
+++ b/gtksourceview/gtksourcecompletion.h
@@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#ifndef __GTK_SOURCE_COMPLETION_H__
#define __GTK_SOURCE_COMPLETION_H__
diff --git a/gtksourceview/gtksourcecompletioncontext.c b/gtksourceview/gtksourcecompletioncontext.c
index 3e0e47f..ecd8147 100644
--- a/gtksourceview/gtksourcecompletioncontext.c
+++ b/gtksourceview/gtksourcecompletioncontext.c
@@ -216,9 +216,9 @@ gtk_source_completion_context_class_init (GtkSourceCompletionContextClass *klass
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkSourceCompletionContextClass, cancelled),
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -278,7 +278,7 @@ gtk_source_completion_context_init (GtkSourceCompletionContext *context)
* @provider: (type GtkSource.CompletionProvider): a #GtkSourceCompletionProvider.
* @proposals: (element-type GtkSource.CompletionProposal): The list of proposals to add.
* @finished: Whether the provider is finished adding proposals.
- *
+ *
* Providers can use this function to add proposals to the completion. They
* can do so asynchronously by means of the @finished argument. Providers must
* ensure that they always call this function with @finished set to %TRUE
@@ -304,7 +304,7 @@ gtk_source_completion_context_add_proposals (GtkSourceCompletionContext *contex
* gtk_source_completion_context_get_iter:
* @context: a #GtkSourceCompletionContext.
* @iter: (out): a #GtkTextIter.
- *
+ *
* Get the iter at which the completion was invoked. Providers can use this
* to determine how and if to match proposals.
**/
diff --git a/gtksourceview/gtksourcecompletionitem.c b/gtksourceview/gtksourcecompletionitem.c
index 9e59ec1..5560fb2 100644
--- a/gtksourceview/gtksourcecompletionitem.c
+++ b/gtksourceview/gtksourcecompletionitem.c
@@ -48,8 +48,8 @@ enum
static void gtk_source_completion_proposal_iface_init (gpointer g_iface, gpointer iface_data);
-G_DEFINE_TYPE_WITH_CODE (GtkSourceCompletionItem,
- gtk_source_completion_item,
+G_DEFINE_TYPE_WITH_CODE (GtkSourceCompletionItem,
+ gtk_source_completion_item,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROPOSAL,
gtk_source_completion_proposal_iface_init))
@@ -85,11 +85,11 @@ gtk_source_completion_proposal_get_info_impl (GtkSourceCompletionProposal *self)
}
static void
-gtk_source_completion_proposal_iface_init (gpointer g_iface,
+gtk_source_completion_proposal_iface_init (gpointer g_iface,
gpointer iface_data)
{
GtkSourceCompletionProposalIface *iface = (GtkSourceCompletionProposalIface *)g_iface;
-
+
/* Interface data getter implementations */
iface->get_label = gtk_source_completion_proposal_get_label_impl;
iface->get_markup = gtk_source_completion_proposal_get_markup_impl;
@@ -102,13 +102,13 @@ static void
gtk_source_completion_item_finalize (GObject *object)
{
GtkSourceCompletionItem *self = GTK_SOURCE_COMPLETION_ITEM(object);
-
+
g_free (self->priv->label);
g_free (self->priv->markup);
g_free (self->priv->text);
g_free (self->priv->info);
-
+
if (self->priv->icon != NULL)
{
g_object_unref (self->priv->icon);
@@ -175,13 +175,13 @@ gtk_source_completion_item_set_property (GObject *object,
case PROP_LABEL:
g_free (self->priv->label);
self->priv->label = g_value_dup_string (value);
-
+
emit_changed (self);
break;
case PROP_MARKUP:
g_free (self->priv->markup);
self->priv->markup = g_value_dup_string (value);
-
+
emit_changed (self);
break;
case PROP_TEXT:
@@ -191,7 +191,7 @@ gtk_source_completion_item_set_property (GObject *object,
case PROP_INFO:
g_free (self->priv->info);
self->priv->info = g_value_dup_string (value);
-
+
emit_changed (self);
break;
case PROP_ICON:
@@ -199,7 +199,7 @@ gtk_source_completion_item_set_property (GObject *object,
{
g_object_unref (self->priv->icon);
}
-
+
self->priv->icon = GDK_PIXBUF (g_value_dup_object (value));
emit_changed (self);
break;
@@ -292,15 +292,15 @@ gtk_source_completion_item_init (GtkSourceCompletionItem *self)
self->priv = GTK_SOURCE_COMPLETION_ITEM_GET_PRIVATE (self);
}
-/**
+/**
* gtk_source_completion_item_new:
* @label: The item label.
* @text: The item text.
* @icon: (allow-none): The item icon.
* @info: (allow-none): The item extra information.
*
- * Create a new #GtkSourceCompletionItem with label @label, icon @icon and
- * extra information @info. Both @icon and @info can be %NULL in which case
+ * Create a new #GtkSourceCompletionItem with label @label, icon @icon and
+ * extra information @info. Both @icon and @info can be %NULL in which case
* there will be no icon shown and no extra information available.
*
* Returns: a new #GtkSourceCompletionItem.
@@ -311,7 +311,7 @@ gtk_source_completion_item_new (const gchar *label,
GdkPixbuf *icon,
const gchar *info)
{
- return g_object_new (GTK_SOURCE_TYPE_COMPLETION_ITEM,
+ return g_object_new (GTK_SOURCE_TYPE_COMPLETION_ITEM,
"label", label,
"text", text,
"icon", icon,
@@ -319,15 +319,15 @@ gtk_source_completion_item_new (const gchar *label,
NULL);
}
-/**
+/**
* gtk_source_completion_item_new_with_markup:
* @markup: The item markup label.
* @text: The item text.
* @icon: (allow-none): The item icon.
* @info: (allow-none): The item extra information.
*
- * Create a new #GtkSourceCompletionItem with markup label @markup, icon
- * @icon and extra information @info. Both @icon and @info can be %NULL in
+ * Create a new #GtkSourceCompletionItem with markup label @markup, icon
+ * @icon and extra information @info. Both @icon and @info can be %NULL in
* which case there will be no icon shown and no extra information available.
*
* Returns: a new #GtkSourceCompletionItem.
@@ -338,7 +338,7 @@ gtk_source_completion_item_new_with_markup (const gchar *markup,
GdkPixbuf *icon,
const gchar *info)
{
- return g_object_new (GTK_SOURCE_TYPE_COMPLETION_ITEM,
+ return g_object_new (GTK_SOURCE_TYPE_COMPLETION_ITEM,
"markup", markup,
"text", text,
"icon", icon,
@@ -346,14 +346,14 @@ gtk_source_completion_item_new_with_markup (const gchar *markup,
NULL);
}
-/**
+/**
* gtk_source_completion_item_new_from_stock:
* @label: (allow-none): The item label.
* @text: The item text.
* @stock: The stock icon.
* @info: (allow-none): The item extra information.
*
- * Creates a new #GtkSourceCompletionItem from a stock item. If @label is %NULL,
+ * Creates a new #GtkSourceCompletionItem from a stock item. If @label is %NULL,
* the stock label will be used.
*
* Returns: a new #GtkSourceCompletionItem.
@@ -370,17 +370,17 @@ gtk_source_completion_item_new_from_stock (const gchar *label,
gint width;
gint height;
GtkStockItem stock_item;
-
+
if (stock != NULL)
{
theme = gtk_icon_theme_get_default ();
-
+
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
- icon = gtk_icon_theme_load_icon (theme,
- stock,
- width,
- GTK_ICON_LOOKUP_USE_BUILTIN,
+ icon = gtk_icon_theme_load_icon (theme,
+ stock,
+ width,
+ GTK_ICON_LOOKUP_USE_BUILTIN,
NULL);
if (label == NULL && gtk_stock_lookup (stock, &stock_item))
@@ -392,13 +392,13 @@ gtk_source_completion_item_new_from_stock (const gchar *label,
{
icon = NULL;
}
-
+
item = gtk_source_completion_item_new (label, text, icon, info);
-
+
if (icon != NULL)
{
g_object_unref (icon);
}
-
+
return item;
}
diff --git a/gtksourceview/gtksourcecompletionitem.h b/gtksourceview/gtksourcecompletionitem.h
index 83ed6c1..5f7be57 100644
--- a/gtksourceview/gtksourcecompletionitem.h
+++ b/gtksourceview/gtksourcecompletionitem.h
@@ -41,7 +41,7 @@ typedef struct _GtkSourceCompletionItemPrivate GtkSourceCompletionItemPrivate;
struct _GtkSourceCompletionItem {
GObject parent;
-
+
GtkSourceCompletionItemPrivate *priv;
};
diff --git a/gtksourceview/gtksourcecompletionmodel.c b/gtksourceview/gtksourcecompletionmodel.c
index e4dd1dc..e82c192 100644
--- a/gtksourceview/gtksourcecompletionmodel.c
+++ b/gtksourceview/gtksourcecompletionmodel.c
@@ -56,11 +56,11 @@ struct _GtkSourceCompletionModelPrivate
GType column_types[GTK_SOURCE_COMPLETION_MODEL_N_COLUMNS];
GList *store;
GList *last;
-
+
GHashTable *providers_info;
GList *providers;
GList *visible_providers;
-
+
guint num;
guint show_headers : 1;
@@ -79,8 +79,8 @@ static guint signals[NUM_SIGNALS] = {0,};
static void tree_model_iface_init (gpointer g_iface, gpointer iface_data);
-G_DEFINE_TYPE_WITH_CODE (GtkSourceCompletionModel,
- gtk_source_completion_model,
+G_DEFINE_TYPE_WITH_CODE (GtkSourceCompletionModel,
+ gtk_source_completion_model,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
tree_model_iface_init))
@@ -118,21 +118,21 @@ path_from_list (GtkSourceCompletionModel *model,
gint index = 0;
GList *ptr;
ProposalNode *node;
-
+
ptr = model->priv->store;
while (ptr && ptr != item)
{
node = (ProposalNode *)ptr->data;
-
+
if (!node->filtered)
{
++index;
}
-
+
ptr = g_list_next (ptr);
}
-
+
if (ptr != item)
{
return NULL;
@@ -187,7 +187,7 @@ get_iter_from_index (GtkSourceCompletionModel *model,
while (item != NULL && index >= 0)
{
node = (ProposalNode *)item->data;
-
+
if (!node->filtered)
{
--index;
@@ -198,7 +198,7 @@ get_iter_from_index (GtkSourceCompletionModel *model,
item = g_list_next (item);
}
}
-
+
if (item != NULL)
{
iter->user_data = item;
@@ -212,19 +212,19 @@ get_iter_from_index (GtkSourceCompletionModel *model,
static gboolean
tree_model_get_iter (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
+ GtkTreeIter *iter,
GtkTreePath *path)
{
GtkSourceCompletionModel *model;
gint *indices;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (path != NULL, FALSE);
-
+
model = GTK_SOURCE_COMPLETION_MODEL (tree_model);
indices = gtk_tree_path_get_indices (path);
-
+
return get_iter_from_index (model, iter, indices[0]);
}
@@ -233,19 +233,19 @@ tree_model_get_path (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GtkSourceCompletionModel *model;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
g_return_val_if_fail (iter->user_data != NULL, NULL);
model = GTK_SOURCE_COMPLETION_MODEL (tree_model);
-
+
return path_from_list (model, (GList *)iter->user_data);
}
static void
tree_model_get_value (GtkTreeModel *tree_model,
- GtkTreeIter *iter,
+ GtkTreeIter *iter,
gint column,
GValue *value)
{
@@ -277,13 +277,13 @@ tree_model_get_value (GtkTreeModel *tree_model,
case GTK_SOURCE_COMPLETION_MODEL_COLUMN_ICON:
if (node->proposal == NULL)
{
- g_value_set_object (value,
+ g_value_set_object (value,
(gpointer)gtk_source_completion_provider_get_icon (
node->provider));
}
else
{
- g_value_set_object (value,
+ g_value_set_object (value,
(gpointer)gtk_source_completion_proposal_get_icon (
node->proposal));
}
@@ -301,15 +301,15 @@ find_first_not_filtered (GtkSourceCompletionModel *model,
while (item)
{
node = (ProposalNode *)item->data;
-
+
if (!node->filtered)
{
break;
}
-
+
item = g_list_next (item);
}
-
+
if (item != NULL)
{
iter->user_data = item;
@@ -326,14 +326,14 @@ tree_model_iter_next (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GList *item;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
-
+
item = g_list_next ((GList *)iter->user_data);
-
- return find_first_not_filtered (GTK_SOURCE_COMPLETION_MODEL (tree_model),
- item,
+
+ return find_first_not_filtered (GTK_SOURCE_COMPLETION_MODEL (tree_model),
+ item,
iter);
}
@@ -345,7 +345,7 @@ tree_model_iter_children (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (parent == NULL || parent->user_data != NULL, FALSE);
-
+
if (parent != NULL)
{
return FALSE;
@@ -364,7 +364,7 @@ tree_model_iter_has_child (GtkTreeModel *tree_model,
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
-
+
return FALSE;
}
@@ -374,7 +374,7 @@ tree_model_iter_n_children (GtkTreeModel *tree_model,
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), 0);
g_return_val_if_fail (iter == NULL || iter->user_data != NULL, 0);
-
+
if (iter == NULL)
{
return GTK_SOURCE_COMPLETION_MODEL (tree_model)->priv->num;
@@ -388,7 +388,7 @@ tree_model_iter_n_children (GtkTreeModel *tree_model,
static gboolean
tree_model_iter_nth_child (GtkTreeModel *tree_model,
GtkTreeIter *iter,
- GtkTreeIter *parent,
+ GtkTreeIter *parent,
gint n)
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), FALSE);
@@ -401,8 +401,8 @@ tree_model_iter_nth_child (GtkTreeModel *tree_model,
}
else
{
- return get_iter_from_index (GTK_SOURCE_COMPLETION_MODEL (tree_model),
- iter,
+ return get_iter_from_index (GTK_SOURCE_COMPLETION_MODEL (tree_model),
+ iter,
n);
}
}
@@ -415,7 +415,7 @@ tree_model_iter_parent (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (tree_model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (child != NULL, FALSE);
-
+
iter->user_data = NULL;
return FALSE;
}
@@ -434,7 +434,7 @@ tree_model_row_deleted (GtkTreeModel *tree_model,
}
static void
-tree_model_iface_init (gpointer g_iface,
+tree_model_iface_init (gpointer g_iface,
gpointer iface_data)
{
GtkTreeModelIface *iface = (GtkTreeModelIface *)g_iface;
@@ -451,7 +451,7 @@ tree_model_iface_init (gpointer g_iface,
iface->iter_n_children = tree_model_iter_n_children;
iface->iter_nth_child = tree_model_iter_nth_child;
iface->iter_parent = tree_model_iter_parent;
-
+
iface->row_inserted = tree_model_row_inserted;
iface->row_deleted = tree_model_row_deleted;
}
@@ -466,9 +466,9 @@ proposal_node_free (ProposalNode *node)
g_signal_handler_disconnect (node->proposal,
node->changed_id);
}
-
+
g_object_unref (node->proposal);
- }
+ }
g_slice_free (ProposalNode, node);
}
@@ -487,10 +487,10 @@ gtk_source_completion_model_dispose (GObject *object)
g_list_free_full (model->priv->store, (GDestroyNotify)proposal_node_free);
model->priv->store = NULL;
model->priv->last = NULL;
-
+
g_list_free (model->priv->providers);
model->priv->providers = NULL;
-
+
G_OBJECT_CLASS (gtk_source_completion_model_parent_class)->dispose (object);
}
@@ -508,7 +508,7 @@ static void
gtk_source_completion_model_class_init (GtkSourceCompletionModelClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
+
object_class->finalize = gtk_source_completion_model_finalize;
object_class->dispose = gtk_source_completion_model_dispose;
@@ -517,9 +517,9 @@ gtk_source_completion_model_class_init (GtkSourceCompletionModelClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkSourceCompletionModelClass, providers_changed),
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -528,9 +528,9 @@ gtk_source_completion_model_class_init (GtkSourceCompletionModelClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkSourceCompletionModelClass, begin_delete),
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -539,9 +539,9 @@ gtk_source_completion_model_class_init (GtkSourceCompletionModelClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkSourceCompletionModelClass, end_delete),
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -561,13 +561,13 @@ static void
gtk_source_completion_model_init (GtkSourceCompletionModel *self)
{
self->priv = GTK_SOURCE_COMPLETION_MODEL_GET_PRIVATE (self);
-
+
self->priv->column_types[GTK_SOURCE_COMPLETION_MODEL_COLUMN_PROVIDER] = G_TYPE_OBJECT;
self->priv->column_types[GTK_SOURCE_COMPLETION_MODEL_COLUMN_PROPOSAL] = G_TYPE_OBJECT;
self->priv->column_types[GTK_SOURCE_COMPLETION_MODEL_COLUMN_LABEL] = G_TYPE_STRING;
self->priv->column_types[GTK_SOURCE_COMPLETION_MODEL_COLUMN_MARKUP] = G_TYPE_STRING;
self->priv->column_types[GTK_SOURCE_COMPLETION_MODEL_COLUMN_ICON] = GDK_TYPE_PIXBUF;
-
+
self->priv->providers_info = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
g_object_unref,
@@ -642,7 +642,7 @@ gtk_source_completion_model_begin (GtkSourceCompletionModel *model,
if (providers != NULL)
{
model->priv->marking = !model->priv->marking;
-
+
/* FIXME: maybe remove providers that are no longer selected now, but
since this is probably a atypical case, it might be a performance
hit (since providers have to be looked up in the GList). Anyway,
@@ -658,7 +658,7 @@ void
gtk_source_completion_model_cancel (GtkSourceCompletionModel *model)
{
GList *item;
-
+
/* If cancelled, mark all proposals correctly so that the fast marking
scheme still works */
for (item = model->priv->store; item != NULL; item = g_list_next (item))
@@ -675,7 +675,7 @@ handle_row_inserted (GtkSourceCompletionModel *model,
GtkTreeIter iter;
GtkTreePath *ppath = NULL;
GtkTreeRowReference *ref = NULL;
-
+
if (path != NULL)
{
ref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), *path);
@@ -684,7 +684,7 @@ handle_row_inserted (GtkSourceCompletionModel *model,
{
ppath = path_from_list (model, item);
}
-
+
iter.user_data = item;
gtk_tree_model_row_inserted (GTK_TREE_MODEL (model),
@@ -696,7 +696,7 @@ handle_row_inserted (GtkSourceCompletionModel *model,
gtk_tree_path_free (*path);
*path = gtk_tree_row_reference_get_path (ref);
gtk_tree_row_reference_free (ref);
-
+
gtk_tree_path_prev (*path);
}
else
@@ -721,7 +721,7 @@ insert_node (GtkSourceCompletionModel *model,
node->changed_id = 0;
node->mark = model->priv->marking;
node->filtered = info->filtered || (!proposal && !model->priv->show_headers);
-
+
if (position == NULL)
{
/* Append after last item */
@@ -735,14 +735,14 @@ insert_node (GtkSourceCompletionModel *model,
model->priv->last = g_list_append (model->priv->last, node);
model->priv->last = g_list_next (model->priv->last);
}
-
+
info->last = model->priv->last;
-
+
if (info->first == NULL)
{
info->first = info->last;
}
-
+
item = model->priv->last;
}
else
@@ -751,22 +751,22 @@ insert_node (GtkSourceCompletionModel *model,
model->priv->store = g_list_insert_before (model->priv->store,
position,
node);
-
+
item = g_list_previous (position);
-
+
if (!info->first || info->first == position)
{
info->first = item;
}
-
+
if (!info->last || info->last->next == item)
{
info->last = item;
}
}
-
+
num_inc (model, info, node);
-
+
if (proposal != NULL)
{
g_hash_table_insert (info->proposals, proposal, item);
@@ -776,7 +776,7 @@ insert_node (GtkSourceCompletionModel *model,
{
handle_row_inserted (model, item, path);
}
-
+
if (proposal != NULL)
{
node->changed_id = g_signal_connect (node->proposal,
@@ -802,7 +802,7 @@ handle_row_deleted (GtkSourceCompletionModel *model,
/* Create a copy here because row_deleted might modify it */
ppath = gtk_tree_path_copy (*path);
}
-
+
gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), ppath);
gtk_tree_path_free (ppath);
}
@@ -831,29 +831,29 @@ remove_node (GtkSourceCompletionModel *model,
{
info->last = g_list_previous (info->last);
}
-
+
if (item == model->priv->last)
{
model->priv->last = g_list_previous (item);
}
-
+
num_dec (model, info, node);
if (path == NULL)
{
ppath = path_from_list (model, item);
}
-
+
if (node->proposal != NULL)
{
g_hash_table_remove (info->proposals, node->proposal);
}
model->priv->store = g_list_delete_link (model->priv->store,
- item);
-
- handle_row_deleted (model, item, path ? path : &ppath);
-
+ item);
+
+ handle_row_deleted (model, item, path ? path : &ppath);
+
if (ppath != NULL)
{
gtk_tree_path_free (ppath);
@@ -937,7 +937,7 @@ update_provider_visibility_show_hide (GtkSourceCompletionModel *model,
item = g_list_next (item);
}
-
+
if (path != NULL)
{
gtk_tree_path_free (path);
@@ -949,7 +949,7 @@ update_provider_visibility_each (GtkSourceCompletionProvider *provider,
ProviderInfo *info,
GtkSourceCompletionModel *model)
{
- if (info->filtered == (model->priv->visible_providers != NULL &&
+ if (info->filtered == (model->priv->visible_providers != NULL &&
g_list_index (model->priv->visible_providers, info->provider) == -1))
{
return;
@@ -973,36 +973,36 @@ remove_unmarked (GtkSourceCompletionModel *model,
GList *item;
gboolean ret = TRUE;
GtkTreePath *path = NULL;
- ProviderInfo *info = g_hash_table_lookup (model->priv->providers_info,
+ ProviderInfo *info = g_hash_table_lookup (model->priv->providers_info,
provider);
if (!info)
{
return FALSE;
}
-
+
g_signal_emit (model, signals[BEGIN_DELETE], 0);
-
+
item = info->first;
while (item)
{
ProposalNode *node = (ProposalNode *)item->data;
-
+
if (node->provider != provider)
{
break;
}
-
+
if (path == NULL)
{
path = path_from_list (model, item);
}
-
+
if (node->proposal != NULL && node->mark != model->priv->marking)
{
GList *next = g_list_next (item);
-
+
// Remove the node here
remove_node (model, info, item, &path);
item = next;
@@ -1013,30 +1013,30 @@ remove_unmarked (GtkSourceCompletionModel *model,
item = g_list_next (item);
}
}
-
+
if (path != NULL)
{
gtk_tree_path_free (path);
}
-
+
if (info->num_proposals == 0 && info->first != NULL && model->priv->show_headers)
{
remove_node (model, info, info->first, NULL);
}
-
+
if (info->num_proposals == 0)
{
g_hash_table_remove (model->priv->providers_info, provider);
-
+
model->priv->providers = g_list_remove (model->priv->providers,
provider);
model->priv->visible_providers = g_list_remove (model->priv->visible_providers,
provider);
-
+
ret = FALSE;
}
-
+
g_signal_emit (model, signals[END_DELETE], 0);
return ret;
}
@@ -1131,7 +1131,7 @@ gtk_source_completion_model_append (GtkSourceCompletionModel *model,
ProviderInfo *info;
GtkTreePath *path = NULL;
gboolean is_new_provider = FALSE;
-
+
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model));
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_PROVIDER (provider));
@@ -1148,29 +1148,29 @@ gtk_source_completion_model_append (GtkSourceCompletionModel *model,
info = add_provider_info (model, provider);
is_new_provider = TRUE;
}
-
+
if (info->first_batch)
{
info->ptr = info->first;
-
+
if (info->ptr && !((ProposalNode *)info->ptr->data)->proposal)
{
info->ptr = g_list_next (info->ptr);
}
}
-
+
info->first_batch = FALSE;
-
+
for (item = proposals; item != NULL; item = g_list_next (item))
{
GtkSourceCompletionProposal *proposal;
GList *nodeitem;
-
+
if (!GTK_SOURCE_IS_COMPLETION_PROPOSAL (item->data))
{
continue;
}
-
+
proposal = GTK_SOURCE_COMPLETION_PROPOSAL (item->data);
nodeitem = g_hash_table_lookup (info->proposals, proposal);
@@ -1178,10 +1178,10 @@ gtk_source_completion_model_append (GtkSourceCompletionModel *model,
{
ProposalNode *node = (ProposalNode *)nodeitem->data;
node->mark = model->priv->marking;
-
+
/* Next items will be inserted after this one */
info->ptr = g_list_next (nodeitem);
-
+
if (path != NULL)
{
gtk_tree_path_free (path);
@@ -1203,17 +1203,17 @@ gtk_source_completion_model_append (GtkSourceCompletionModel *model,
path = gtk_tree_path_new_from_indices (model->priv->num, -1);
}
}
-
+
insert_node (model, info, insert_before, proposal, &path);
gtk_tree_path_next (path);
}
}
-
+
if (path != NULL)
{
gtk_tree_path_free (path);
}
-
+
if (is_new_provider)
{
g_signal_emit (model, signals[PROVIDERS_CHANGED], 0);
@@ -1225,7 +1225,7 @@ gtk_source_completion_model_end (GtkSourceCompletionModel *model,
GtkSourceCompletionProvider *provider)
{
/* Remove unmarked proposals, returns TRUE if there are any proposals
- * left for 'provider'. If so, we add 'provider' to the list of
+ * left for 'provider'. If so, we add 'provider' to the list of
* currently active providers
*/
if (!remove_unmarked (model, provider))
@@ -1248,11 +1248,11 @@ gtk_source_completion_model_clear (GtkSourceCompletionModel *model)
{
GtkTreePath *path;
ProviderInfo *info = NULL;
-
+
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model));
-
+
path = gtk_tree_path_new_first ();
-
+
while (model->priv->store)
{
ProposalNode *node;
@@ -1260,19 +1260,19 @@ gtk_source_completion_model_clear (GtkSourceCompletionModel *model)
node = (ProposalNode *)model->priv->store->data;
model->priv->store = g_list_delete_link (model->priv->store, model->priv->store);
-
+
if (model->priv->store == NULL)
{
model->priv->last = NULL;
}
-
+
if (info == NULL || info->provider != node->provider)
{
info = g_hash_table_lookup (model->priv->providers_info, node->provider);
}
num_dec (model, info, node);
-
+
if (!node->filtered)
{
gtk_tree_model_row_deleted (GTK_TREE_MODEL (model), path);
@@ -1282,15 +1282,15 @@ gtk_source_completion_model_clear (GtkSourceCompletionModel *model)
}
gtk_tree_path_free (path);
-
+
g_hash_table_remove_all (model->priv->providers_info);
g_list_free (model->priv->providers);
-
+
model->priv->providers = NULL;
g_list_free (model->priv->visible_providers);
model->priv->visible_providers = NULL;
-
+
g_signal_emit (model, signals[PROVIDERS_CHANGED], 0);
}
@@ -1310,7 +1310,7 @@ gtk_source_completion_model_is_empty (GtkSourceCompletionModel *model,
gboolean invisible)
{
gboolean isempty = TRUE;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), FALSE);
if (!invisible)
@@ -1332,12 +1332,12 @@ gtk_source_completion_model_n_proposals (GtkSourceCompletionModel *model,
GtkSourceCompletionProvider *provider)
{
ProviderInfo *info;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), 0);
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_PROVIDER (provider), 0);
-
+
info = g_hash_table_lookup (model->priv->providers_info, provider);
-
+
if (info == NULL)
{
return 0;
@@ -1348,7 +1348,7 @@ gtk_source_completion_model_n_proposals (GtkSourceCompletionModel *model,
}
}
-void
+void
gtk_source_completion_model_set_show_headers (GtkSourceCompletionModel *model,
gboolean show_headers)
{
@@ -1379,18 +1379,18 @@ gtk_source_completion_model_iter_previous (GtkSourceCompletionModel *model,
GtkTreeIter *iter)
{
GList *item;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
g_return_val_if_fail (iter->user_data != NULL, FALSE);
-
+
item = iter->user_data;
-
+
do
{
item = g_list_previous (item);
} while (item && ((ProposalNode *)item->data)->filtered);
-
+
if (item != NULL)
{
iter->user_data = item;
@@ -1407,10 +1407,10 @@ gtk_source_completion_model_iter_last (GtkSourceCompletionModel *model,
GtkTreeIter *iter)
{
GList *item;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
-
+
item = model->priv->last;
iter->user_data = item;
@@ -1432,19 +1432,19 @@ GList *
gtk_source_completion_model_get_providers (GtkSourceCompletionModel *model)
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), NULL);
-
+
return model->priv->providers;
}
-void
+void
gtk_source_completion_model_set_visible_providers (GtkSourceCompletionModel *model,
GList *providers)
{
g_return_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model));
-
+
g_list_free (model->priv->visible_providers);
model->priv->visible_providers = g_list_copy (providers);
-
+
update_provider_visibility (model);
}
@@ -1452,7 +1452,7 @@ GList *
gtk_source_completion_model_get_visible_providers (GtkSourceCompletionModel *model)
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), NULL);
-
+
return model->priv->visible_providers;
}
@@ -1462,6 +1462,6 @@ gtk_source_completion_model_iter_equal (GtkSourceCompletionModel *model,
GtkTreeIter *iter2)
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_MODEL (model), FALSE);
-
+
return iter1->user_data == iter2->user_data;
}
diff --git a/gtksourceview/gtksourcecompletionmodel.h b/gtksourceview/gtksourcecompletionmodel.h
index 99c50e9..ccf6155 100644
--- a/gtksourceview/gtksourcecompletionmodel.h
+++ b/gtksourceview/gtksourcecompletionmodel.h
@@ -42,13 +42,13 @@ typedef struct _GtkSourceCompletionModelPrivate GtkSourceCompletionModelPrivate;
struct _GtkSourceCompletionModel {
GObject parent;
-
+
GtkSourceCompletionModelPrivate *priv;
};
struct _GtkSourceCompletionModelClass {
GObjectClass parent_class;
-
+
void (*providers_changed) (GtkSourceCompletionModel *model);
void (*begin_delete) (GtkSourceCompletionModel *model);
void (*end_delete) (GtkSourceCompletionModel *model);
@@ -100,7 +100,7 @@ gboolean gtk_source_completion_model_iter_is_header (GtkSourceCompletionModel
gboolean gtk_source_completion_model_iter_previous (GtkSourceCompletionModel *model,
GtkTreeIter *iter);
-
+
gboolean gtk_source_completion_model_iter_last (GtkSourceCompletionModel *model,
GtkTreeIter *iter);
diff --git a/gtksourceview/gtksourcecompletionproposal.c b/gtksourceview/gtksourcecompletionproposal.c
index c308c17..86446da 100644
--- a/gtksourceview/gtksourcecompletionproposal.c
+++ b/gtksourceview/gtksourcecompletionproposal.c
@@ -90,20 +90,20 @@ gtk_source_completion_proposal_equal_default (GtkSourceCompletionProposal *propo
return g_direct_equal (proposal, other);
}
-static void
+static void
gtk_source_completion_proposal_default_init (GtkSourceCompletionProposalIface *iface)
{
static gboolean initialized = FALSE;
-
+
iface->get_label = gtk_source_completion_proposal_get_label_default;
iface->get_markup = gtk_source_completion_proposal_get_markup_default;
iface->get_text = gtk_source_completion_proposal_get_text_default;
-
+
iface->get_icon = gtk_source_completion_proposal_get_icon_default;
iface->get_info = gtk_source_completion_proposal_get_info_default;
iface->hash = gtk_source_completion_proposal_hash_default;
iface->equal = gtk_source_completion_proposal_equal_default;
-
+
if (!initialized)
{
/**
@@ -114,14 +114,14 @@ gtk_source_completion_proposal_default_init (GtkSourceCompletionProposalIface *i
* will react to this by updating the shown information.
*
*/
- signals[CHANGED] =
+ signals[CHANGED] =
g_signal_new ("changed",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkSourceCompletionProposalIface, changed),
- NULL,
NULL,
- g_cclosure_marshal_VOID__VOID,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
@@ -152,7 +152,7 @@ gtk_source_completion_proposal_get_label (GtkSourceCompletionProposal *proposal)
* gtk_source_completion_proposal_get_markup:
* @proposal: a #GtkSourceCompletionProposal.
*
- * Gets the label of @proposal with markup. The label is shown in the list of
+ * Gets the label of @proposal with markup. The label is shown in the list of
* proposals and may contain markup. This will be used instead of
* #gtk_source_completion_proposal_get_label if implemented. The returned string
* must be freed with g_free().
@@ -224,7 +224,7 @@ gtk_source_completion_proposal_get_info (GtkSourceCompletionProposal *proposal)
/**
* gtk_source_completion_proposal_hash:
* @proposal: a #GtkSourceCompletionProposal.
- *
+ *
* Get the hash value of @proposal. This is used to (together with
* #gtk_source_completion_proposal_equal) to match proposals in the completion
* model. By default, it uses a direct hash (#g_direct_hash).
@@ -243,9 +243,9 @@ gtk_source_completion_proposal_hash (GtkSourceCompletionProposal *proposal)
* gtk_source_completion_proposal_equal:
* @proposal: a #GtkSourceCompletionProposal.
* @other: a #GtkSourceCompletionProposal.
- *
- * Get whether two proposal objects are the same. This is used to (together
- * with #gtk_source_completion_proposal_hash) to match proposals in the
+ *
+ * Get whether two proposal objects are the same. This is used to (together
+ * with #gtk_source_completion_proposal_hash) to match proposals in the
* completion model. By default, it uses direct equality (#g_direct_equal).
*
* Returns: %TRUE if @proposal and @object are the same proposal
@@ -256,7 +256,7 @@ gtk_source_completion_proposal_equal (GtkSourceCompletionProposal *proposal,
{
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_PROPOSAL (proposal), FALSE);
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_PROPOSAL (other), FALSE);
-
+
return GTK_SOURCE_COMPLETION_PROPOSAL_GET_INTERFACE (proposal)->equal (proposal, other);
}
diff --git a/gtksourceview/gtksourcecompletionproposal.h b/gtksourceview/gtksourcecompletionproposal.h
index bb1827c..12725a9 100644
--- a/gtksourceview/gtksourcecompletionproposal.h
+++ b/gtksourceview/gtksourcecompletionproposal.h
@@ -39,19 +39,19 @@ typedef struct _GtkSourceCompletionProposalIface GtkSourceCompletionProposalIfac
struct _GtkSourceCompletionProposalIface
{
GTypeInterface parent;
-
+
/* Interface functions */
gchar *(*get_label) (GtkSourceCompletionProposal *proposal);
gchar *(*get_markup) (GtkSourceCompletionProposal *proposal);
gchar *(*get_text) (GtkSourceCompletionProposal *proposal);
-
+
GdkPixbuf *(*get_icon) (GtkSourceCompletionProposal *proposal);
gchar *(*get_info) (GtkSourceCompletionProposal *proposal);
-
+
guint (*hash) (GtkSourceCompletionProposal *proposal);
gboolean (*equal) (GtkSourceCompletionProposal *proposal,
GtkSourceCompletionProposal *other);
-
+
/* Signals */
void (*changed) (GtkSourceCompletionProposal *proposal);
};
diff --git a/gtksourceview/gtksourcecompletionprovider.c b/gtksourceview/gtksourcecompletionprovider.c
index 114290e..15fe148 100644
--- a/gtksourceview/gtksourcecompletionprovider.c
+++ b/gtksourceview/gtksourcecompletionprovider.c
@@ -27,7 +27,7 @@
* @short_description: Completion provider interface
*
* You must implement this interface to provide proposals to #GtkSourceCompletion
- *
+ *
*/
#include <gtksourceview/gtksourcecompletionprovider.h>
@@ -114,11 +114,11 @@ gtk_source_completion_provider_get_priority_default (GtkSourceCompletionProvider
return 0;
}
-static void
+static void
gtk_source_completion_provider_default_init (GtkSourceCompletionProviderIface *iface)
{
static gboolean initialized = FALSE;
-
+
iface->get_name = gtk_source_completion_provider_get_name_default;
iface->get_icon = gtk_source_completion_provider_get_icon_default;
@@ -126,10 +126,10 @@ gtk_source_completion_provider_default_init (GtkSourceCompletionProviderIface *i
iface->match = gtk_source_completion_provider_match_default;
iface->get_activation = gtk_source_completion_provider_get_activation_default;
-
+
iface->get_info_widget = gtk_source_completion_provider_get_info_widget_default;
iface->update_info = gtk_source_completion_provider_update_info_default;
-
+
iface->get_start_iter = gtk_source_completion_provider_get_start_iter_default;
iface->activate_proposal = gtk_source_completion_provider_activate_proposal_default;
@@ -196,7 +196,7 @@ gtk_source_completion_provider_populate (GtkSourceCompletionProvider *provider,
/**
* gtk_source_completion_provider_get_activation:
* @provider: a #GtkSourceCompletionProvider.
- *
+ *
* Get with what kind of activation the provider should be activated.
*
* Returns: a combination of #GtkSourceCompletionActivation.
@@ -237,9 +237,9 @@ gtk_source_completion_provider_match (GtkSourceCompletionProvider *provider,
* Get a customized info widget to show extra information of a proposal.
* This allows for customized widgets on a proposal basis, although in general
* providers will have the same custom widget for all their proposals and
- * @proposal can be ignored. The implementation of this function is optional.
+ * @proposal can be ignored. The implementation of this function is optional.
* If implemented, #gtk_source_completion_provider_update_info MUST also be
- * implemented. If not implemented, the default
+ * implemented. If not implemented, the default
* #gtk_source_completion_proposal_get_info will be used to display extra
* information about a #GtkSourceCompletionProposal.
*
@@ -264,10 +264,10 @@ gtk_source_completion_provider_get_info_widget (GtkSourceCompletionProvider *pro
*
* Update extra information shown in @info for @proposal. This should be
* implemented if your provider sets a custom info widget for @proposal.
- * This function MUST be implemented when
+ * This function MUST be implemented when
* #gtk_source_completion_provider_get_info_widget is implemented.
*/
-void
+void
gtk_source_completion_provider_update_info (GtkSourceCompletionProvider *provider,
GtkSourceCompletionProposal *proposal,
GtkSourceCompletionInfo *info)
@@ -285,7 +285,7 @@ gtk_source_completion_provider_update_info (GtkSourceCompletionProvider *provide
* @proposal: a #GtkSourceCompletionProposal.
* @context: a #GtkSourceCompletionContext.
* @iter: a #GtkTextIter.
- *
+ *
* Get the #GtkTextIter at which the completion for @proposal starts. When
* implemented, the completion can use this information to position the
* completion window accordingly when a proposal is selected in the completion
@@ -304,7 +304,7 @@ gtk_source_completion_provider_get_start_iter (GtkSourceCompletionProvider *prov
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_PROPOSAL (proposal), FALSE);
g_return_val_if_fail (iter != NULL, FALSE);
- return GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->get_start_iter (provider,
+ return GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->get_start_iter (provider,
context,
proposal,
iter);
@@ -331,7 +331,7 @@ gtk_source_completion_provider_activate_proposal (GtkSourceCompletionProvider *p
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_PROVIDER (provider), FALSE);
g_return_val_if_fail (GTK_SOURCE_IS_COMPLETION_PROPOSAL (proposal), FALSE);
- return GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->activate_proposal (provider,
+ return GTK_SOURCE_COMPLETION_PROVIDER_GET_INTERFACE (provider)->activate_proposal (provider,
proposal,
iter);
}
diff --git a/gtksourceview/gtksourcecompletionprovider.h b/gtksourceview/gtksourcecompletionprovider.h
index 514e7b3..b89da15 100644
--- a/gtksourceview/gtksourcecompletionprovider.h
+++ b/gtksourceview/gtksourcecompletionprovider.h
@@ -48,7 +48,7 @@ typedef struct _GtkSourceCompletionProviderIface GtkSourceCompletionProviderIfac
struct _GtkSourceCompletionProviderIface
{
GTypeInterface g_iface;
-
+
gchar *(*get_name) (GtkSourceCompletionProvider *provider);
GdkPixbuf *(*get_icon) (GtkSourceCompletionProvider *provider);
void (*populate) (GtkSourceCompletionProvider *provider,
diff --git a/gtksourceview/gtksourcecompletionutils.c b/gtksourceview/gtksourcecompletionutils.c
index 8edcbb4..1ce75f0 100644
--- a/gtksourceview/gtksourcecompletionutils.c
+++ b/gtksourceview/gtksourcecompletionutils.c
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <string.h>
+#include <string.h>
#include "gtksourcecompletionutils.h"
/**
@@ -34,12 +34,12 @@
gboolean
gtk_source_completion_utils_is_separator (const gunichar ch)
{
- if (g_unichar_isprint(ch) &&
+ if (g_unichar_isprint(ch) &&
(g_unichar_isalnum(ch) || ch == g_utf8_get_char("_")))
{
return FALSE;
}
-
+
return TRUE;
}
@@ -49,21 +49,21 @@ gtk_source_completion_utils_is_separator (const gunichar ch)
* @source_buffer: a #GtkSourceBuffer.
* @start_word: (allow-none): if != NULL then assign it the start position of the word
* @end_word: (allow-none): if != NULL then assing it the end position of the word
- *
+ *
* Returns: the current word.
*/
gchar *
-gtk_source_completion_utils_get_word_iter (GtkSourceBuffer *source_buffer,
+gtk_source_completion_utils_get_word_iter (GtkSourceBuffer *source_buffer,
GtkTextIter *current,
- GtkTextIter *start_word,
+ GtkTextIter *start_word,
GtkTextIter *end_word)
{
GtkTextBuffer *text_buffer;
gunichar ch;
gboolean no_doc_start;
-
+
text_buffer = GTK_TEXT_BUFFER (source_buffer);
-
+
if (current == NULL)
{
gtk_text_buffer_get_iter_at_mark (text_buffer,
@@ -74,7 +74,7 @@ gtk_source_completion_utils_get_word_iter (GtkSourceBuffer *source_buffer,
{
*start_word = *current;
}
-
+
*end_word = *start_word;
while ((no_doc_start = gtk_text_iter_backward_char (start_word)) == TRUE)
@@ -86,7 +86,7 @@ gtk_source_completion_utils_get_word_iter (GtkSourceBuffer *source_buffer,
break;
}
}
-
+
if (!no_doc_start)
{
gtk_text_buffer_get_start_iter (text_buffer, start_word);
@@ -110,12 +110,12 @@ gtk_source_completion_utils_get_word (GtkSourceBuffer *source_buffer)
{
GtkTextIter start;
GtkTextIter end;
-
+
return gtk_source_completion_utils_get_word_iter (source_buffer, NULL, &start, &end);
}
static void
-get_iter_pos (GtkSourceView *source_view,
+get_iter_pos (GtkSourceView *source_view,
GtkTextIter *iter,
gint *x,
gint *y,
@@ -130,19 +130,19 @@ get_iter_pos (GtkSourceView *source_view,
gint yy;
text_view = GTK_TEXT_VIEW (source_view);
-
+
gtk_text_view_get_iter_location (text_view, iter, &location);
gtk_text_view_buffer_to_window_coords (text_view,
GTK_TEXT_WINDOW_WIDGET,
- location.x,
+ location.x,
location.y,
- &win_x,
+ &win_x,
&win_y);
win = gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_WIDGET);
gdk_window_get_origin (win, &xx, &yy);
-
+
*x = win_x + xx;
*y = win_y + yy + location.height;
*height = location.height;
@@ -161,16 +161,16 @@ gtk_source_completion_utils_replace_word (GtkSourceBuffer *source_buffer,
GtkTextMark *mark;
g_return_if_fail (GTK_SOURCE_IS_BUFFER (source_buffer));
-
+
buffer = GTK_TEXT_BUFFER (source_buffer);
gtk_text_buffer_begin_user_action (buffer);
-
+
mark = gtk_text_buffer_create_mark (buffer, NULL, iter, TRUE);
word = gtk_source_completion_utils_get_word_iter (source_buffer, iter, &word_start, &word_end);
g_free (word);
gtk_text_buffer_delete (buffer, &word_start, &word_end);
-
+
if (text != NULL)
{
gtk_text_buffer_insert (buffer, &word_start, text, len);
@@ -186,17 +186,17 @@ gtk_source_completion_utils_replace_word (GtkSourceBuffer *source_buffer,
* gtk_source_completion_utils_replace_current_word:
* @source_buffer: a #GtkSourceBuffer.
* @text: (allow-none): The text to be inserted instead of the current word.
- *
+ *
* Replaces the current word in the #GtkSourceBuffer with the new word.
*/
void
-gtk_source_completion_utils_replace_current_word (GtkSourceBuffer *source_buffer,
+gtk_source_completion_utils_replace_current_word (GtkSourceBuffer *source_buffer,
const gchar *text,
gint len)
{
GtkTextIter iter;
GtkTextMark *mark;
-
+
g_return_if_fail (GTK_SOURCE_IS_BUFFER (source_buffer));
mark = gtk_text_buffer_get_insert (GTK_TEXT_BUFFER (source_buffer));
@@ -218,9 +218,9 @@ compensate_for_gravity (GtkWindow *window,
gint h)
{
GdkGravity gravity;
-
+
gravity = gtk_window_get_gravity (window);
-
+
/* Horizontal */
switch (gravity)
{
@@ -238,7 +238,7 @@ compensate_for_gravity (GtkWindow *window,
*x = 0;
break;
}
-
+
/* Vertical */
switch (gravity)
{
@@ -312,7 +312,7 @@ gtk_source_completion_utils_move_to_iter (GtkWindow *window,
{
screen = gdk_screen_get_default ();
}
-
+
sw = gdk_screen_get_width (screen);
sh = gdk_screen_get_height (screen);
@@ -346,10 +346,10 @@ gtk_source_completion_utils_move_to_iter (GtkWindow *window,
{
overlapup = TRUE;
}
-
+
/* Make sure that text is still readable */
move_overlap (&x, &y, w, h, oy, cx, cy, height, overlapup);
-
+
gtk_window_move (window, x, y);
}
@@ -359,16 +359,16 @@ gtk_source_completion_utils_move_to_iter (GtkWindow *window,
* @view: the #GtkSoureView.
*
*/
-void
+void
gtk_source_completion_utils_move_to_cursor (GtkWindow *window,
GtkSourceView *view)
{
GtkTextBuffer *buffer;
GtkTextIter insert;
-
+
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_get_iter_at_mark (buffer, &insert, gtk_text_buffer_get_insert (buffer));
-
+
gtk_source_completion_utils_move_to_iter (window,
view,
&insert);
diff --git a/gtksourceview/gtksourcecompletionutils.h b/gtksourceview/gtksourcecompletionutils.h
index 3bd5acb..42353a2 100644
--- a/gtksourceview/gtksourcecompletionutils.h
+++ b/gtksourceview/gtksourcecompletionutils.h
@@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#ifndef __GTK_SOURCE_COMPLETION_UTILS_H__
#define __GTK_SOURCE_COMPLETION_UTILS_H__
@@ -29,9 +29,9 @@ G_BEGIN_DECLS
gboolean gtk_source_completion_utils_is_separator (gunichar ch);
-gchar *gtk_source_completion_utils_get_word_iter (GtkSourceBuffer *source_buffer,
+gchar *gtk_source_completion_utils_get_word_iter (GtkSourceBuffer *source_buffer,
GtkTextIter *current,
- GtkTextIter *start_word,
+ GtkTextIter *start_word,
GtkTextIter *end_word);
gchar *gtk_source_completion_utils_get_word (GtkSourceBuffer *text_view);
@@ -41,7 +41,7 @@ void gtk_source_completion_utils_replace_word (GtkSourceBuffer *source_buffer
const gchar *text,
gint len);
-void gtk_source_completion_utils_replace_current_word (GtkSourceBuffer *source_buffer,
+void gtk_source_completion_utils_replace_current_word (GtkSourceBuffer *source_buffer,
const gchar *text,
gint len);
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index 874b7f2..d8caf67 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -2104,7 +2104,7 @@ gtk_source_context_engine_text_deleted (GtkSourceEngine *engine,
GtkSourceContextEngine *ce = GTK_SOURCE_CONTEXT_ENGINE (engine);
g_return_if_fail (length > 0);
-
+
if (!ce->priv->disabled)
{
invalidate_region (ce, offset, - length);
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index 5ce4b49..ea784ec 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -37,7 +37,7 @@
* The #GtkSourceGutter object represents the left and right gutters of the text
* view. It is used by #GtkSourceView to draw the line numbers and category
* marks that might be present on a line. By packing additional #GtkSourceGutterRenderer
- * objects in the gutter, you can extend the gutter with your own custom
+ * objects in the gutter, you can extend the gutter with your own custom
* drawings.
*
* The gutter works very much the same way as cells rendered in a #GtkTreeView.
diff --git a/gtksourceview/gtksourcegutterrenderer.c b/gtksourceview/gtksourcegutterrenderer.c
index f7b5735..e692f82 100644
--- a/gtksourceview/gtksourcegutterrenderer.c
+++ b/gtksourceview/gtksourcegutterrenderer.c
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* GtkSourceView is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/gtksourceview/gtksourcegutterrendererlines.c b/gtksourceview/gtksourcegutterrendererlines.c
index 52df1b6..d04a586 100644
--- a/gtksourceview/gtksourcegutterrendererlines.c
+++ b/gtksourceview/gtksourcegutterrendererlines.c
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* GtkSourceView is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/gtksourceview/gtksourcegutterrenderermarks.c b/gtksourceview/gtksourcegutterrenderermarks.c
index ca25189..bd90bfd 100644
--- a/gtksourceview/gtksourcegutterrenderermarks.c
+++ b/gtksourceview/gtksourcegutterrenderermarks.c
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* GtkSourceView is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/gtksourceview/gtksourcegutterrendererpixbuf.h b/gtksourceview/gtksourcegutterrendererpixbuf.h
index b407bc2..6c88678 100644
--- a/gtksourceview/gtksourcegutterrendererpixbuf.h
+++ b/gtksourceview/gtksourcegutterrendererpixbuf.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcegutterrenderertext.h
- * This file is part of GtkSourceView
+ * This file is part of GtkSourceView
*
* Copyright (C) 2010 - Jesse van den Kieboom
*
diff --git a/gtksourceview/gtksourcegutterrenderertext.h b/gtksourceview/gtksourcegutterrenderertext.h
index 5fb1813..50c188d 100644
--- a/gtksourceview/gtksourcegutterrenderertext.h
+++ b/gtksourceview/gtksourcegutterrenderertext.h
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourcegutterrenderertext.h
- * This file is part of GtkSourceView
+ * This file is part of GtkSourceView
*
* Copyright (C) 2010 - Jesse van den Kieboom
*
diff --git a/gtksourceview/gtksourcelanguage.c b/gtksourceview/gtksourcelanguage.c
index 168a43a..b42921d 100644
--- a/gtksourceview/gtksourcelanguage.c
+++ b/gtksourceview/gtksourcelanguage.c
@@ -576,7 +576,7 @@ gtk_source_language_get_metadata (GtkSourceLanguage *language,
* array.
*
* Returns: (array zero-terminated=1) (transfer full): a newly-allocated
- * %NULL terminated array containing the mime types or %NULL if no
+ * %NULL terminated array containing the mime types or %NULL if no
* mime types are found.
* The returned array must be freed with g_strfreev().
**/
diff --git a/gtksourceview/gtksourcelanguagemanager.c b/gtksourceview/gtksourcelanguagemanager.c
index a3ebd64..9acf58a 100644
--- a/gtksourceview/gtksourcelanguagemanager.c
+++ b/gtksourceview/gtksourcelanguagemanager.c
@@ -578,13 +578,13 @@ pick_lang_for_mime_type (GtkSourceLanguageManager *lm,
if (alt_filename != NULL)
{
GSList *langs;
-
+
langs = pick_langs_for_filename (lm, alt_filename);
-
+
if (langs != NULL)
lang = GTK_SOURCE_LANGUAGE (langs->data);
}
-
+
if (lang == NULL && mime_type != NULL)
lang = pick_lang_for_mime_type_real (lm, mime_type);
@@ -669,46 +669,46 @@ gtk_source_language_manager_guess_language (GtkSourceLanguageManager *lm,
if (content_type != NULL)
{
GSList *l;
-
+
for (l = langs; l != NULL; l = g_slist_next (l))
{
gchar **mime_types, **gptr;
-
+
lang = GTK_SOURCE_LANGUAGE (l->data);
mime_types = gtk_source_language_get_mime_types (lang);
-
+
for (gptr = mime_types; gptr != NULL && *gptr != NULL; gptr++)
{
gchar *content;
-
+
content = g_content_type_from_mime_type (*gptr);
-
+
if (content != NULL && g_content_type_is_a (content_type, content))
{
if (!g_content_type_equals (content_type, content))
{
GtkSourceLanguage *mimelang;
-
+
mimelang = pick_lang_for_mime_type (lm, content_type);
-
+
if (mimelang != NULL)
lang = mimelang;
}
-
+
g_strfreev (mime_types);
g_slist_free (langs);
g_free (content);
-
+
return lang;
}
g_free (content);
}
-
+
g_strfreev (mime_types);
}
}
lang = GTK_SOURCE_LANGUAGE (langs->data);
-
+
g_slist_free (langs);
}
/* No glob match */
diff --git a/gtksourceview/gtksourcemark.c b/gtksourceview/gtksourcemark.c
index b036cb9..4fb19b0 100644
--- a/gtksourceview/gtksourcemark.c
+++ b/gtksourceview/gtksourcemark.c
@@ -156,14 +156,14 @@ gtk_source_mark_init (GtkSourceMark *mark)
* gtk_source_mark_new:
* @name: Name of the #GtkSourceMark, can be NULL when not using a name
* @category: is used to classify marks according to common characteristics
- * (e.g. all the marks representing a bookmark could belong to the "bookmark"
- * category, or all the marks representing a compilation error could belong to
+ * (e.g. all the marks representing a bookmark could belong to the "bookmark"
+ * category, or all the marks representing a compilation error could belong to
* "error" category).
*
- * Creates a text mark. Add it to a buffer using gtk_text_buffer_add_mark().
+ * Creates a text mark. Add it to a buffer using gtk_text_buffer_add_mark().
* If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved
* by name using gtk_text_buffer_get_mark().
- * Normally marks are created using the utility function
+ * Normally marks are created using the utility function
* gtk_source_buffer_create_mark().
*
* Returns: a new #GtkSourceMark that can be added using gtk_text_buffer_add_mark().
@@ -176,8 +176,8 @@ gtk_source_mark_new (const gchar *name,
{
g_return_val_if_fail (category != NULL, NULL);
- return GTK_SOURCE_MARK (g_object_new (GTK_SOURCE_TYPE_MARK,
- "category", category,
+ return GTK_SOURCE_MARK (g_object_new (GTK_SOURCE_TYPE_MARK,
+ "category", category,
"name", name,
"left-gravity", TRUE,
NULL));
@@ -238,7 +238,7 @@ gtk_source_mark_next (GtkSourceMark *mark,
*
* Returns the previous #GtkSourceMark in the buffer or %NULL if the mark
* was not added to a buffer. If there is no previous mark, %NULL is returned.
- *
+ *
* If @category is %NULL, looks for marks of any category
*
* Returns: (transfer none): the previous #GtkSourceMark, or %NULL.
diff --git a/gtksourceview/gtksourcemark.h b/gtksourceview/gtksourcemark.h
index 59b9e19..8e23996 100644
--- a/gtksourceview/gtksourcemark.h
+++ b/gtksourceview/gtksourcemark.h
@@ -56,7 +56,7 @@ struct _GtkSourceMarkClass
GType gtk_source_mark_get_type (void) G_GNUC_CONST;
-GtkSourceMark *gtk_source_mark_new (const gchar *name,
+GtkSourceMark *gtk_source_mark_new (const gchar *name,
const gchar *category);
const gchar *gtk_source_mark_get_category (GtkSourceMark *mark);
diff --git a/gtksourceview/gtksourceprintcompositor.c b/gtksourceview/gtksourceprintcompositor.c
index 1f0e1f3..5026b38 100644
--- a/gtksourceview/gtksourceprintcompositor.c
+++ b/gtksourceview/gtksourceprintcompositor.c
@@ -2,7 +2,7 @@
* gtksourceprintcompositor.c
* This file is part of GtkSourceView
*
- * Copyright (C) 2000, 2001 Chema Celorio
+ * Copyright (C) 2000, 2001 Chema Celorio
* Copyright (C) 2003 Gustavo GirÃldez
* Copyright (C) 2004 Red Hat, Inc.
* Copyright (C) 2001-2007 Paolo Maggi
@@ -12,17 +12,17 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* GtkSourceView is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -30,7 +30,7 @@
#include <string.h>
#include <time.h>
-#include "gtksourceview-i18n.h"
+#include "gtksourceview-i18n.h"
#include "gtksourceprintcompositor.h"
/**
@@ -88,16 +88,16 @@ static GTimer *pagination_timer = NULL;
/* Number of pages paginated on each invocation of the paginate() method. */
#define PAGINATION_CHUNK_SIZE 3
-typedef enum
+typedef enum
{
/* Initial state: properties can be changed only when the paginator
is in the INIT state */
INIT,
-
+
/* Paginating state: paginator goes in this state when the paginate
function is called for the first time */
PAGINATING,
-
+
/* Done state: paginator goes in this state when the entire document
has been paginated */
DONE
@@ -112,7 +112,7 @@ struct _GtkSourcePrintCompositorPrivate
GtkWrapMode wrap_mode;
gboolean highlight_syntax;
guint print_line_numbers;
-
+
PangoFontDescription *body_font;
PangoFontDescription *line_numbers_font;
PangoFontDescription *header_font;
@@ -138,11 +138,11 @@ struct _GtkSourcePrintCompositorPrivate
gchar *footer_format_left;
gchar *footer_format_center;
gchar *footer_format_right;
- gboolean footer_separator;
+ gboolean footer_separator;
/* State */
PaginatorState state;
-
+
GArray *pages; /* pages[i] contains the begin offset
of i-th */
@@ -157,23 +157,23 @@ struct _GtkSourcePrintCompositorPrivate
gdouble line_numbers_height;
gdouble footer_font_descent;
-
+
/* layout objects */
PangoLayout *layout;
PangoLayout *line_numbers_layout;
PangoLayout *header_layout;
- PangoLayout *footer_layout;
+ PangoLayout *footer_layout;
gdouble real_margin_top;
gdouble real_margin_bottom;
gdouble real_margin_left;
gdouble real_margin_right;
-
+
gdouble page_margin_top;
- gdouble page_margin_left;
-
+ gdouble page_margin_left;
+
PangoLanguage *language; /* must not be freed */
-
+
GtkTextMark *pagination_mark;
};
@@ -209,7 +209,7 @@ convert_to_mm (gdouble len, GtkUnit unit)
case GTK_UNIT_INCH:
return len * MM_PER_INCH;
-
+
default:
case GTK_UNIT_PIXEL:
g_warning ("Unsupported unit");
@@ -227,10 +227,10 @@ convert_from_mm (gdouble len, GtkUnit unit)
{
case GTK_UNIT_MM:
return len;
-
+
case GTK_UNIT_INCH:
return len / MM_PER_INCH;
-
+
default:
case GTK_UNIT_PIXEL:
g_warning ("Unsupported unit");
@@ -241,7 +241,7 @@ convert_from_mm (gdouble len, GtkUnit unit)
}
}
-static void
+static void
gtk_source_print_compositor_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -250,7 +250,7 @@ gtk_source_print_compositor_get_property (GObject *object,
GtkSourcePrintCompositor *compositor = GTK_SOURCE_PRINT_COMPOSITOR (object);
switch (prop_id)
- {
+ {
case PROP_BUFFER:
g_value_set_object (value, compositor->priv->buffer);
break;
@@ -273,11 +273,11 @@ gtk_source_print_compositor_get_property (GObject *object,
case PROP_PRINT_HEADER:
g_value_set_boolean (value,
gtk_source_print_compositor_get_print_header (compositor));
- break;
+ break;
case PROP_PRINT_FOOTER:
g_value_set_boolean (value,
- gtk_source_print_compositor_get_print_footer (compositor));
- break;
+ gtk_source_print_compositor_get_print_footer (compositor));
+ break;
case PROP_BODY_FONT_NAME:
g_value_set_string (value,
gtk_source_print_compositor_get_body_font_name (compositor));
@@ -304,14 +304,14 @@ gtk_source_print_compositor_get_property (GObject *object,
}
}
-static void
+static void
gtk_source_print_compositor_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkSourcePrintCompositor *compositor = GTK_SOURCE_PRINT_COMPOSITOR (object);
-
+
switch (prop_id)
{
case PROP_BUFFER:
@@ -339,7 +339,7 @@ gtk_source_print_compositor_set_property (GObject *object,
case PROP_PRINT_FOOTER:
gtk_source_print_compositor_set_print_footer (compositor, g_value_get_boolean (value));
- break;
+ break;
case PROP_BODY_FONT_NAME:
gtk_source_print_compositor_set_body_font_name (compositor,
g_value_get_string (value));
@@ -355,7 +355,7 @@ gtk_source_print_compositor_set_property (GObject *object,
case PROP_FOOTER_FONT_NAME:
gtk_source_print_compositor_set_footer_font_name (compositor,
g_value_get_string (value));
- break;
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -371,7 +371,7 @@ gtk_source_print_compositor_finalize (GObject *object)
if (compositor->priv->pages != NULL)
g_array_free (compositor->priv->pages, TRUE);
-
+
if (compositor->priv->layout != NULL)
g_object_unref (compositor->priv->layout);
@@ -417,11 +417,11 @@ gtk_source_print_compositor_dispose (GObject *object)
G_OBJECT_CLASS (gtk_source_print_compositor_parent_class)->dispose (object);
}
-static void
+static void
gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
{
GObjectClass *object_class;
-
+
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = gtk_source_print_compositor_get_property;
@@ -449,8 +449,8 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
*
* Width of a tab character expressed in spaces.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -470,8 +470,8 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
*
* Whether to wrap lines never, at word boundaries, or at character boundaries.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -490,9 +490,9 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
* GtkSourcePrintCompositor:highlight-syntax:
*
* Whether to print the document with highlighted syntax.
- *
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ *
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -513,9 +513,9 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
* numbers will be printed. If greater than 0, a number will be
* printed every "print-line-numbers" lines (i.e. 1 will print all line numbers).
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
- *
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
+ *
* Since: 2.2
*/
g_object_class_install_property (object_class,
@@ -526,18 +526,18 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
"(0 means no numbers)"),
0, 100, 1,
G_PARAM_READWRITE));
-
+
/**
* GtkSourcePrintCompositor:print-header:
- *
+ *
* Whether to print a header in each page.
*
* Note that by default the header format is unspecified, and if it is
- * unspecified the header will not be printed, regardless of the value of
+ * unspecified the header will not be printed, regardless of the value of
* this property.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -552,15 +552,15 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
/**
* GtkSourcePrintCompositor:print-footer:
- *
+ *
* Whether to print a footer in each page.
*
* Note that by default the footer format is unspecified, and if it is
- * unspecified the footer will not be printed, regardless of the value of
+ * unspecified the footer will not be printed, regardless of the value of
* this property.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -576,17 +576,17 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
/**
* GtkSourcePrintCompositor:body-font-name:
*
- * Name of the font used for the text body.
+ * Name of the font used for the text body.
*
* Accepted values are strings representing a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
- */
+ */
g_object_class_install_property (object_class,
PROP_BODY_FONT_NAME,
g_param_spec_string ("body-font-name",
@@ -599,15 +599,15 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
/**
* GtkSourcePrintCompositor:line-numbers-font-name:
*
- * Name of the font used to print line numbers on the left margin.
+ * Name of the font used to print line numbers on the left margin.
* If this property is unspecified, the text body font is used.
*
* Accepted values are strings representing a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -616,22 +616,22 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
g_param_spec_string ("line-numbers-font-name",
_("Line Numbers Font Name"),
_("Name of the font to use for the line numbers "
- "(e.g. \"Monospace 10\")"),
+ "(e.g. \"Monospace 10\")"),
NULL,
G_PARAM_READWRITE));
/**
* GtkSourcePrintCompositor:header-font-name:
*
- * Name of the font used to print page header.
+ * Name of the font used to print page header.
* If this property is unspecified, the text body font is used.
*
* Accepted values are strings representing a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -640,22 +640,22 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
g_param_spec_string ("header-font-name",
_("Header Font Name"),
_("Name of the font to use for the page header "
- "(e.g. \"Monospace 10\")"),
+ "(e.g. \"Monospace 10\")"),
NULL,
G_PARAM_READWRITE));
/**
* GtkSourcePrintCompositor:footer-font-name:
*
- * Name of the font used to print page footer.
+ * Name of the font used to print page footer.
* If this property is unspecified, the text body font is used.
*
* Accepted values are strings representing a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * The value of this property cannot be changed anymore after the first
- * call to the gtk_source_print_compositor_paginate() function.
+ * The value of this property cannot be changed anymore after the first
+ * call to the gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -664,14 +664,14 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
g_param_spec_string ("footer-font-name",
_("Footer Font Name"),
_("Name of the font to use for the page footer "
- "(e.g. \"Monospace 10\")"),
+ "(e.g. \"Monospace 10\")"),
NULL,
G_PARAM_READWRITE));
/**
* GtkSourcePrintCompositor:n-pages:
*
- * The number of pages in the document or <code>-1</code> if the
+ * The number of pages in the document or <code>-1</code> if the
* document has not been completely paginated.
*
* Since: 2.2
@@ -686,22 +686,22 @@ gtk_source_print_compositor_class_init (GtkSourcePrintCompositorClass *klass)
-1, G_MAXINT, -1,
G_PARAM_READABLE));
- g_type_class_add_private (object_class, sizeof(GtkSourcePrintCompositorPrivate));
+ g_type_class_add_private (object_class, sizeof(GtkSourcePrintCompositorPrivate));
}
static void
gtk_source_print_compositor_init (GtkSourcePrintCompositor *compositor)
{
GtkSourcePrintCompositorPrivate *priv;
-
- priv = G_TYPE_INSTANCE_GET_PRIVATE (compositor,
+
+ priv = G_TYPE_INSTANCE_GET_PRIVATE (compositor,
GTK_SOURCE_TYPE_PRINT_COMPOSITOR,
GtkSourcePrintCompositorPrivate);
compositor->priv = priv;
-
+
priv->buffer = NULL;
-
+
priv->tab_width = DEFAULT_TAB_WIDTH;
priv->wrap_mode = GTK_WRAP_NONE;
priv->highlight_syntax = TRUE;
@@ -727,27 +727,27 @@ gtk_source_print_compositor_init (GtkSourcePrintCompositor *compositor)
priv->header_format_center = NULL;
priv->header_format_right = NULL;
priv->header_separator = FALSE;
-
+
priv->footer_format_left = NULL;
priv->footer_format_center = NULL;
priv->footer_format_right = NULL;
priv->footer_separator = FALSE;
-
+
priv->state = INIT;
-
+
priv->pages = NULL;
-
+
priv->paginated_lines = 0;
priv->n_pages = -1;
priv->current_page = -1;
-
+
priv->layout = NULL;
priv->line_numbers_layout = NULL;
priv->language = gtk_get_default_language ();
/* Negative values mean uninitialized */
- priv->header_height = -1.0;
+ priv->header_height = -1.0;
priv->footer_height = -1.0;
priv->line_numbers_width = -1.0;
priv->line_numbers_height = -1.0;
@@ -756,9 +756,9 @@ gtk_source_print_compositor_init (GtkSourcePrintCompositor *compositor)
/**
* gtk_source_print_compositor_new:
* @buffer: the #GtkSourceBuffer to print.
- *
+ *
* Creates a new print compositor that can be used to print @buffer.
- *
+ *
* Return value: a new print compositor object.
*
* Since: 2.2
@@ -767,7 +767,7 @@ GtkSourcePrintCompositor *
gtk_source_print_compositor_new (GtkSourceBuffer *buffer)
{
g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (buffer), NULL);
-
+
return g_object_new (GTK_SOURCE_TYPE_PRINT_COMPOSITOR,
"buffer", buffer,
NULL);
@@ -776,12 +776,12 @@ gtk_source_print_compositor_new (GtkSourceBuffer *buffer)
/**
* gtk_source_print_compositor_new_from_view:
* @view: a #GtkSourceView to get configuration from.
- *
+ *
* Creates a new print compositor that can be used to print the buffer
* associated with @view.
- * This constructor sets some configuration properties to make the
+ * This constructor sets some configuration properties to make the
* printed output match @view as much as possible. The properties set are
- * #GtkSourcePrintCompositor:tab-width, #GtkSourcePrintCompositor:highlight-syntax,
+ * #GtkSourcePrintCompositor:tab-width, #GtkSourcePrintCompositor:highlight-syntax,
* #GtkSourcePrintCompositor:wrap-mode, #GtkSourcePrintCompositor:body-font-name and
* #GtkSourcePrintCompositor:print-line-numbers.
*
@@ -796,12 +796,12 @@ gtk_source_print_compositor_new_from_view (GtkSourceView *view)
PangoContext *pango_context;
PangoFontDescription* font_desc;
GtkSourcePrintCompositor *compositor;
-
+
g_return_val_if_fail (GTK_SOURCE_IS_VIEW (view), NULL);
- g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view))), NULL);
buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
-
+
compositor = GTK_SOURCE_PRINT_COMPOSITOR (
g_object_new (GTK_SOURCE_TYPE_PRINT_COMPOSITOR,
"buffer", buffer,
@@ -813,23 +813,23 @@ gtk_source_print_compositor_new_from_view (GtkSourceView *view)
/* Set the body font directly since the property get a name while body_font is a PangoFontDescription */
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (view));
-
+
font_desc = pango_context_get_font_description (pango_context);
-
+
compositor->priv->body_font = pango_font_description_copy (font_desc);
g_object_notify (G_OBJECT (compositor), "body-font-name"); // FIXME: is this needed?
-
+
return compositor;
}
/**
* gtk_source_print_compositor_get_buffer:
* @compositor: a #GtkSourcePrintCompositor.
- *
+ *
* Gets the #GtkSourceBuffer associated with the compositor. The returned
* object reference is owned by the compositor object and
* should not be unreferenced.
- *
+ *
* Return value: (transfer none): the #GtkSourceBuffer associated with the compositor.
*
* Since: 2.2
@@ -838,7 +838,7 @@ GtkSourceBuffer *
gtk_source_print_compositor_get_buffer (GtkSourcePrintCompositor *compositor)
{
g_return_val_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor), NULL);
-
+
return compositor->priv->buffer;
}
@@ -847,9 +847,9 @@ gtk_source_print_compositor_get_buffer (GtkSourcePrintCompositor *compositor)
* @compositor: a #GtkSourcePrintCompositor.
* @width: width of tab in characters.
*
- * Sets the width of tabulation in characters for printed text.
+ * Sets the width of tabulation in characters for printed text.
*
- * This function cannot be called anymore after the first call to the
+ * This function cannot be called anymore after the first call to the
* gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
@@ -861,10 +861,10 @@ gtk_source_print_compositor_set_tab_width (GtkSourcePrintCompositor *compositor,
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (width > 0 && width <= MAX_TAB_WIDTH);
g_return_if_fail (compositor->priv->state == INIT);
-
+
if (width == compositor->priv->tab_width)
return;
-
+
compositor->priv->tab_width = width;
g_object_notify (G_OBJECT (compositor), "tab-width");
@@ -895,8 +895,8 @@ gtk_source_print_compositor_get_tab_width (GtkSourcePrintCompositor *compositor)
*
* Sets the line wrapping mode for the printed text.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -909,7 +909,7 @@ gtk_source_print_compositor_set_wrap_mode (GtkSourcePrintCompositor *compositor,
if (wrap_mode == compositor->priv->wrap_mode)
return;
-
+
compositor->priv->wrap_mode = wrap_mode;
g_object_notify (G_OBJECT (compositor), "wrap-mode");
@@ -929,7 +929,7 @@ GtkWrapMode
gtk_source_print_compositor_get_wrap_mode (GtkSourcePrintCompositor *compositor)
{
g_return_val_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor), GTK_WRAP_NONE);
-
+
return compositor->priv->wrap_mode;
}
@@ -937,12 +937,12 @@ gtk_source_print_compositor_get_wrap_mode (GtkSourcePrintCompositor *compositor)
* gtk_source_print_compositor_set_highlight_syntax:
* @compositor: a #GtkSourcePrintCompositor.
* @highlight: whether syntax should be highlighted.
- *
+ *
* Sets whether the printed text will be highlighted according to the
* buffer rules. Both color and font style are applied.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
**/
@@ -954,7 +954,7 @@ gtk_source_print_compositor_set_highlight_syntax (GtkSourcePrintCompositor *comp
g_return_if_fail (compositor->priv->state == INIT);
highlight = (highlight != FALSE);
-
+
if (highlight == compositor->priv->highlight_syntax)
return;
@@ -970,7 +970,7 @@ gtk_source_print_compositor_set_highlight_syntax (GtkSourcePrintCompositor *comp
* Determines whether the printed text will be highlighted according to the
* buffer rules. Note that highlighting will happen
* only if the buffer to print has highlighting activated.
- *
+ *
* Return value: %TRUE if the printed output will be highlighted.
*
* Since: 2.2
@@ -987,15 +987,15 @@ gtk_source_print_compositor_get_highlight_syntax (GtkSourcePrintCompositor *comp
* gtk_source_print_compositor_set_print_line_numbers:
* @compositor: a #GtkSourcePrintCompositor.
* @interval: interval for printed line numbers.
- *
+ *
* Sets the interval for printed line numbers. If @interval is 0 no
* numbers will be printed. If greater than 0, a number will be
* printed every @interval lines (i.e. 1 will print all line numbers).
*
* Maximum accepted value for @interval is 100.
- *
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ *
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
**/
@@ -1006,10 +1006,10 @@ gtk_source_print_compositor_set_print_line_numbers (GtkSourcePrintCompositor *co
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (compositor->priv->state == INIT);
g_return_if_fail (interval <= 100);
-
+
if (interval == compositor->priv->print_line_numbers)
return;
-
+
compositor->priv->print_line_numbers = interval;
g_object_notify (G_OBJECT (compositor), "print-line-numbers");
@@ -1019,8 +1019,8 @@ gtk_source_print_compositor_set_print_line_numbers (GtkSourcePrintCompositor *co
* gtk_source_print_compositor_set_print_header:
* @compositor: a #GtkSourcePrintCompositor.
* @print: %TRUE if you want the header to be printed.
- *
- * Sets whether you want to print a header in each page. The
+ *
+ * Sets whether you want to print a header in each page. The
* header consists of three pieces of text and an optional line
* separator, configurable with
* gtk_source_print_compositor_set_header_format().
@@ -1028,8 +1028,8 @@ gtk_source_print_compositor_set_print_line_numbers (GtkSourcePrintCompositor *co
* Note that by default the header format is unspecified, and if it's
* empty it will not be printed, regardless of this setting.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
**/
@@ -1039,26 +1039,26 @@ gtk_source_print_compositor_set_print_header (GtkSourcePrintCompositor *composit
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (compositor->priv->state == INIT);
-
+
print = (print != FALSE);
-
+
if (print == compositor->priv->print_header)
return;
-
+
compositor->priv->print_header = print;
- g_object_notify (G_OBJECT (compositor), "print-header");
+ g_object_notify (G_OBJECT (compositor), "print-header");
}
/**
* gtk_source_print_compositor_get_print_header:
* @compositor: a #GtkSourcePrintCompositor.
- *
+ *
* Determines if a header is set to be printed for each page. A
* header will be printed if this function returns %TRUE
* <emphasis>and</emphasis> some format strings have been specified
* with gtk_source_print_compositor_set_header_format().
- *
+ *
* Return value: %TRUE if the header is set to be printed.
*
* Since: 2.2
@@ -1075,8 +1075,8 @@ gtk_source_print_compositor_get_print_header (GtkSourcePrintCompositor *composit
* gtk_source_print_compositor_set_print_footer:
* @compositor: a #GtkSourcePrintCompositor.
* @print: %TRUE if you want the footer to be printed.
- *
- * Sets whether you want to print a footer in each page. The
+ *
+ * Sets whether you want to print a footer in each page. The
* footer consists of three pieces of text and an optional line
* separator, configurable with
* gtk_source_print_compositor_set_footer_format().
@@ -1084,8 +1084,8 @@ gtk_source_print_compositor_get_print_header (GtkSourcePrintCompositor *composit
* Note that by default the footer format is unspecified, and if it's
* empty it will not be printed, regardless of this setting.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
**/
@@ -1095,26 +1095,26 @@ gtk_source_print_compositor_set_print_footer (GtkSourcePrintCompositor *composit
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (compositor->priv->state == INIT);
-
+
print = (print != FALSE);
-
+
if (print == compositor->priv->print_footer)
return;
-
+
compositor->priv->print_footer = print;
- g_object_notify (G_OBJECT (compositor), "print-footer");
+ g_object_notify (G_OBJECT (compositor), "print-footer");
}
/**
* gtk_source_print_compositor_get_print_footer:
* @compositor: a #GtkSourcePrintCompositor.
- *
+ *
* Determines if a footer is set to be printed for each page. A
* footer will be printed if this function returns %TRUE
* <emphasis>and</emphasis> some format strings have been specified
* with gtk_source_print_compositor_set_footer_format().
- *
+ *
* Return value: %TRUE if the footer is set to be printed.
*
* Since: 2.2
@@ -1134,7 +1134,7 @@ gtk_source_print_compositor_get_print_footer (GtkSourcePrintCompositor *composit
* @left: (allow-none): a format string to print on the left of the header.
* @center: (allow-none): a format string to print on the center of the header.
* @right: (allow-none): a format string to print on the right of the header.
- *
+ *
* Sets strftime like header format strings, to be printed on the
* left, center and right of the top of each page. The strings may
* include strftime(3) codes which will be expanded at print time.
@@ -1146,17 +1146,17 @@ gtk_source_print_compositor_get_print_footer (GtkSourcePrintCompositor *composit
*
* If %NULL is given for any of the three arguments, that particular
* string will not be printed.
- *
+ *
* For the header to be printed, in
* addition to specifying format strings, you need to enable header
* printing with gtk_source_print_compositor_set_print_header().
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
**/
-void
+void
gtk_source_print_compositor_set_header_format (GtkSourcePrintCompositor *compositor,
gboolean separator,
const gchar *left,
@@ -1165,17 +1165,17 @@ gtk_source_print_compositor_set_header_format (GtkSourcePrintCompositor *composi
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (compositor->priv->state == INIT);
-
+
/* FIXME: validate given strings? */
g_free (compositor->priv->header_format_left);
g_free (compositor->priv->header_format_center);
g_free (compositor->priv->header_format_right);
-
+
compositor->priv->header_separator = separator;
compositor->priv->header_format_left = g_strdup (left);
compositor->priv->header_format_center = g_strdup (center);
- compositor->priv->header_format_right = g_strdup (right);
+ compositor->priv->header_format_right = g_strdup (right);
}
/**
@@ -1185,7 +1185,7 @@ gtk_source_print_compositor_set_header_format (GtkSourcePrintCompositor *composi
* @left: (allow-none): a format string to print on the left of the footer.
* @center: (allow-none): a format string to print on the center of the footer.
* @right: (allow-none): a format string to print on the right of the footer.
- *
+ *
* Sets strftime like header format strings, to be printed on the
* left, center and right of the bottom of each page. The strings may
* include strftime(3) codes which will be expanded at print time.
@@ -1202,12 +1202,12 @@ gtk_source_print_compositor_set_header_format (GtkSourcePrintCompositor *composi
* addition to specifying format strings, you need to enable footer
* printing with gtk_source_print_compositor_set_print_footer().
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
**/
-void
+void
gtk_source_print_compositor_set_footer_format (GtkSourcePrintCompositor *compositor,
gboolean separator,
const gchar *left,
@@ -1221,9 +1221,9 @@ gtk_source_print_compositor_set_footer_format (GtkSourcePrintCompositor *composi
g_free (compositor->priv->footer_format_left);
g_free (compositor->priv->footer_format_center);
g_free (compositor->priv->footer_format_right);
-
+
compositor->priv->footer_separator = separator;
-
+
compositor->priv->footer_format_left = g_strdup (left);
compositor->priv->footer_format_center = g_strdup (center);
compositor->priv->footer_format_right = g_strdup (right);
@@ -1236,7 +1236,7 @@ gtk_source_print_compositor_set_footer_format (GtkSourcePrintCompositor *composi
* Returns the interval used for line number printing. If the
* value is 0, no line numbers will be printed. The default value is
* 1 (i.e. numbers printed in all lines).
- *
+ *
* Return value: the interval of printed line numbers.
*
* Since: 2.2
@@ -1256,13 +1256,13 @@ set_font_description_from_name (GtkSourcePrintCompositor *compositor,
{
PangoFontDescription *new;
- if (font_name != NULL)
+ if (font_name != NULL)
new = pango_font_description_from_string (font_name);
else
{
g_return_val_if_fail (compositor->priv->body_font != NULL, FALSE);
new = pango_font_description_copy (compositor->priv->body_font);
- }
+ }
if (*font == NULL || !pango_font_description_equal (*font, new))
{
@@ -1285,15 +1285,15 @@ set_font_description_from_name (GtkSourcePrintCompositor *compositor,
* @compositor: a #GtkSourcePrintCompositor.
* @font_name: the name of the default font for the body text.
*
- * Sets the default font for the printed text.
+ * Sets the default font for the printed text.
*
* @font_name should be a
* string representation of a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
- *
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * for a description of the format of the string representation.
+ *
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -1303,7 +1303,7 @@ gtk_source_print_compositor_set_body_font_name (GtkSourcePrintCompositor *compos
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (font_name != NULL);
- g_return_if_fail (compositor->priv->state == INIT);
+ g_return_if_fail (compositor->priv->state == INIT);
if (set_font_description_from_name (compositor,
&compositor->priv->body_font,
@@ -1320,7 +1320,7 @@ gtk_source_print_compositor_set_body_font_name (GtkSourcePrintCompositor *compos
* Returns the name of the font used to print the text body. The returned string
* must be freed with g_free().
*
- * Return value: a new string containing the name of the font used to print the
+ * Return value: a new string containing the name of the font used to print the
* text body.
*
* Since: 2.2
@@ -1340,15 +1340,15 @@ gtk_source_print_compositor_get_body_font_name (GtkSourcePrintCompositor *compos
*
* Sets the font for printing line numbers on the left margin. If
* %NULL is supplied, the default font (i.e. the one being used for the
- * text) will be used instead.
+ * text) will be used instead.
*
* @font_name should be a
* string representation of a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -1358,10 +1358,10 @@ gtk_source_print_compositor_set_line_numbers_font_name (GtkSourcePrintCompositor
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (font_name != NULL);
- g_return_if_fail (compositor->priv->state == INIT);
+ g_return_if_fail (compositor->priv->state == INIT);
if (set_font_description_from_name (compositor,
- &compositor->priv->line_numbers_font,
+ &compositor->priv->line_numbers_font,
font_name))
{
g_object_notify (G_OBJECT (compositor), "line-numbers-font-name");
@@ -1372,10 +1372,10 @@ gtk_source_print_compositor_set_line_numbers_font_name (GtkSourcePrintCompositor
* gtk_source_print_compositor_get_line_numbers_font_name:
* @compositor: a #GtkSourcePrintCompositor.
*
- * Returns the name of the font used to print line numbers on the left margin.
+ * Returns the name of the font used to print line numbers on the left margin.
* The returned string must be freed with g_free().
*
- * Return value: a new string containing the name of the font used to print
+ * Return value: a new string containing the name of the font used to print
* line numbers on the left margin.
*
* Since: 2.2
@@ -1390,7 +1390,7 @@ gtk_source_print_compositor_get_line_numbers_font_name (GtkSourcePrintCompositor
g_return_val_if_fail (compositor->priv->body_font != NULL, NULL);
compositor->priv->line_numbers_font = pango_font_description_copy (compositor->priv->body_font);
}
-
+
return pango_font_description_to_string (compositor->priv->line_numbers_font);
}
@@ -1401,15 +1401,15 @@ gtk_source_print_compositor_get_line_numbers_font_name (GtkSourcePrintCompositor
*
* Sets the font for printing the page header. If
* %NULL is supplied, the default font (i.e. the one being used for the
- * text) will be used instead.
+ * text) will be used instead.
*
* @font_name should be a
* string representation of a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -1419,10 +1419,10 @@ gtk_source_print_compositor_set_header_font_name (GtkSourcePrintCompositor *comp
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (font_name != NULL);
- g_return_if_fail (compositor->priv->state == INIT);
+ g_return_if_fail (compositor->priv->state == INIT);
if (set_font_description_from_name (compositor,
- &compositor->priv->header_font,
+ &compositor->priv->header_font,
font_name))
{
@@ -1434,10 +1434,10 @@ gtk_source_print_compositor_set_header_font_name (GtkSourcePrintCompositor *comp
* gtk_source_print_compositor_get_header_font_name:
* @compositor: a #GtkSourcePrintCompositor.
*
- * Returns the name of the font used to print the page header.
+ * Returns the name of the font used to print the page header.
* The returned string must be freed with g_free().
*
- * Return value: a new string containing the name of the font used to print
+ * Return value: a new string containing the name of the font used to print
* the page header.
*
* Since: 2.2
@@ -1463,15 +1463,15 @@ gtk_source_print_compositor_get_header_font_name (GtkSourcePrintCompositor *comp
*
* Sets the font for printing the page footer. If
* %NULL is supplied, the default font (i.e. the one being used for the
- * text) will be used instead.
+ * text) will be used instead.
*
* @font_name should be a
* string representation of a font description Pango can understand.
* (e.g. "Monospace 10"). See pango_font_description_from_string()
- * for a description of the format of the string representation.
+ * for a description of the format of the string representation.
*
- * This function cannot be called anymore after the first call to the
- * gtk_source_print_compositor_paginate() function.
+ * This function cannot be called anymore after the first call to the
+ * gtk_source_print_compositor_paginate() function.
*
* Since: 2.2
*/
@@ -1481,10 +1481,10 @@ gtk_source_print_compositor_set_footer_font_name (GtkSourcePrintCompositor *comp
{
g_return_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor));
g_return_if_fail (font_name != NULL);
- g_return_if_fail (compositor->priv->state == INIT);
+ g_return_if_fail (compositor->priv->state == INIT);
if (set_font_description_from_name (compositor,
- &compositor->priv->footer_font,
+ &compositor->priv->footer_font,
font_name))
{
@@ -1496,10 +1496,10 @@ gtk_source_print_compositor_set_footer_font_name (GtkSourcePrintCompositor *comp
* gtk_source_print_compositor_get_footer_font_name:
* @compositor: a #GtkSourcePrintCompositor.
*
- * Returns the name of the font used to print the page footer.
+ * Returns the name of the font used to print the page footer.
* The returned string must be freed with g_free().
*
- * Return value: a new string containing the name of the font used to print
+ * Return value: a new string containing the name of the font used to print
* the page footer.
*
* Since: 2.2
@@ -1523,7 +1523,7 @@ gtk_source_print_compositor_get_footer_font_name (GtkSourcePrintCompositor *comp
* @compositor: a #GtkSourcePrintCompositor.
* @margin: the new top margin in units of @unit
* @unit: the units for @margin
- *
+ *
* Sets the top margin used by @compositor.
*
* Since: 2.2
@@ -1542,9 +1542,9 @@ gtk_source_print_compositor_set_top_margin (GtkSourcePrintCompositor *compositor
* gtk_source_print_compositor_get_top_margin:
* @compositor: a #GtkSourcePrintCompositor.
* @unit: the unit for the return value.
- *
+ *
* Gets the top margin in units of @unit.
- *
+ *
* Return value: the top margin.
*
* Since: 2.2
@@ -1563,7 +1563,7 @@ gtk_source_print_compositor_get_top_margin (GtkSourcePrintCompositor *compositor
* @compositor: a #GtkSourcePrintCompositor.
* @margin: the new bottom margin in units of @unit.
* @unit: the units for @margin.
- *
+ *
* Sets the bottom margin used by @compositor.
*
* Since: 2.2
@@ -1582,9 +1582,9 @@ gtk_source_print_compositor_set_bottom_margin (GtkSourcePrintCompositor *composi
* gtk_source_print_compositor_get_bottom_margin:
* @compositor: a #GtkSourcePrintCompositor.
* @unit: the unit for the return value.
- *
+ *
* Gets the bottom margin in units of @unit.
- *
+ *
* Return value: the bottom margin.
*
* Since: 2.2
@@ -1603,7 +1603,7 @@ gtk_source_print_compositor_get_bottom_margin (GtkSourcePrintCompositor *composi
* @compositor: a #GtkSourcePrintCompositor.
* @margin: the new left margin in units of @unit.
* @unit: the units for @margin.
- *
+ *
* Sets the left margin used by @compositor.
*
* Since: 2.2
@@ -1622,9 +1622,9 @@ gtk_source_print_compositor_set_left_margin (GtkSourcePrintCompositor *composito
* gtk_source_print_compositor_get_left_margin:
* @compositor: a #GtkSourcePrintCompositor.
* @unit: the unit for the return value.
- *
+ *
* Gets the left margin in units of @unit.
- *
+ *
* Return value: the left margin
*
* Since: 2.2
@@ -1643,7 +1643,7 @@ gtk_source_print_compositor_get_left_margin (GtkSourcePrintCompositor *composito
* @compositor: a #GtkSourcePrintCompositor.
* @margin: the new right margin in units of @unit.
* @unit: the units for @margin.
- *
+ *
* Sets the right margin used by @compositor.
*
* Since: 2.2
@@ -1662,9 +1662,9 @@ gtk_source_print_compositor_set_right_margin (GtkSourcePrintCompositor *composit
* gtk_source_print_compositor_get_right_margin:
* @compositor: a #GtkSourcePrintCompositor.
* @unit: the unit for the return value.
- *
+ *
* Gets the right margin in units of @unit.
- *
+ *
* Return value: the right margin.
*
* Since: 2.2
@@ -1681,11 +1681,11 @@ gtk_source_print_compositor_get_right_margin (GtkSourcePrintCompositor *composit
/**
* gtk_source_print_compositor_get_n_pages:
* @compositor: a #GtkSourcePrintCompositor.
- *
- * Returns the number of pages in the document or <code>-1</code> if the
+ *
+ * Returns the number of pages in the document or <code>-1</code> if the
* document has not been completely paginated.
*
- * Return value: the number of pages in the document or <code>-1</code> if the
+ * Return value: the number of pages in the document or <code>-1</code> if the
* document has not been completely paginated.
*
* Since: 2.2
@@ -1740,7 +1740,7 @@ static gdouble
get_text_width (GtkSourcePrintCompositor *compositor)
{
gdouble w;
-
+
w = compositor->priv->paper_width -
compositor->priv->real_margin_left -
compositor->priv->real_margin_right;
@@ -1752,7 +1752,7 @@ get_text_width (GtkSourcePrintCompositor *compositor)
g_warning ("Printable page width too little.");
return convert_from_mm (50, GTK_UNIT_POINTS);
}
-
+
return w;
}
@@ -1778,7 +1778,7 @@ get_text_height (GtkSourcePrintCompositor *compositor)
static gboolean
is_header_to_print (GtkSourcePrintCompositor *compositor)
{
- return (compositor->priv->print_header &&
+ return (compositor->priv->print_header &&
((compositor->priv->header_format_left != NULL) ||
(compositor->priv->header_format_center != NULL) ||
(compositor->priv->header_format_right != NULL)));
@@ -1787,7 +1787,7 @@ is_header_to_print (GtkSourcePrintCompositor *compositor)
static gboolean
is_footer_to_print (GtkSourcePrintCompositor *compositor)
{
- return (compositor->priv->print_footer &&
+ return (compositor->priv->print_footer &&
((compositor->priv->footer_format_left != NULL) ||
(compositor->priv->footer_format_center != NULL) ||
(compositor->priv->footer_format_right != NULL)));
@@ -1844,10 +1844,10 @@ setup_pango_layouts (GtkSourcePrintCompositor *compositor,
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
break;
case GTK_WRAP_NONE:
- /* FIXME: hack
+ /* FIXME: hack
* Ellipsize the paragraph when text wrapping is disabled.
- * Another possibility would be to set the width so the text
- * breaks into multiple lines, and paginate/render just the
+ * Another possibility would be to set the width so the text
+ * breaks into multiple lines, and paginate/render just the
* first one.
* See also Comment #23 by Owen on bug #143874.
*/
@@ -1887,7 +1887,7 @@ setup_pango_layouts (GtkSourcePrintCompositor *compositor,
g_return_if_fail (compositor->priv->header_layout == NULL);
compositor->priv->header_layout = layout;
}
-
+
/* Layout for footer */
if (is_footer_to_print (compositor))
{
@@ -1900,7 +1900,7 @@ setup_pango_layouts (GtkSourcePrintCompositor *compositor,
g_return_if_fail (compositor->priv->footer_layout == NULL);
compositor->priv->footer_layout = layout;
- }
+ }
}
/* ---- Header and footer ---- */
@@ -1931,7 +1931,7 @@ strdup_strftime (const gchar *format, const struct tm *tm)
g_warning (G_STRLOC "Error converting format to locale encoding: %s",
error->message);
g_error_free (error);
-
+
return NULL;
}
@@ -1939,18 +1939,18 @@ strdup_strftime (const gchar *format, const struct tm *tm)
while (TRUE)
{
tmpbuf = g_malloc (tmpbufsize);
-
+
/* Set the first byte to something other than '\0', to be able to
* recognize whether strftime actually failed or just returned "".
*/
tmpbuf[0] = '\1';
tmplen = strftime (tmpbuf, tmpbufsize, locale_format, tm);
-
+
if (tmplen == 0 && tmpbuf[0] != '\0')
{
g_free (tmpbuf);
tmpbufsize *= 2;
-
+
if (tmpbufsize > 65536)
{
g_warning (G_STRLOC "Maximum buffer size for strdup_strftime "
@@ -1972,7 +1972,7 @@ strdup_strftime (const gchar *format, const struct tm *tm)
g_warning (G_STRLOC "Error converting results of strftime to UTF-8: %s",
error->message);
g_error_free (error);
-
+
return NULL;
}
@@ -1988,7 +1988,7 @@ evaluate_format_string (GtkSourcePrintCompositor *compositor,
const struct tm *tm;
time_t now;
gunichar ch;
-
+
/* get time */
time (&now);
tm = localtime (&now);
@@ -2066,23 +2066,23 @@ calculate_line_numbers_layout_size (GtkSourcePrintCompositor *compositor,
if (compositor->priv->print_line_numbers == 0)
{
compositor->priv->line_numbers_width = 0.0;
- compositor->priv->line_numbers_height = 0.0;
+ compositor->priv->line_numbers_height = 0.0;
DEBUG ({
- g_debug ("line_numbers_width: %f points (%f mm)",
- compositor->priv->line_numbers_width,
+ g_debug ("line_numbers_width: %f points (%f mm)",
+ compositor->priv->line_numbers_width,
convert_to_mm (compositor->priv->line_numbers_width, GTK_UNIT_POINTS));
- g_debug ("line_numbers_height: %f points (%f mm)",
+ g_debug ("line_numbers_height: %f points (%f mm)",
compositor->priv->line_numbers_height,
convert_to_mm (compositor->priv->line_numbers_height, GTK_UNIT_POINTS));
});
-
+
return;
}
line_count = gtk_text_buffer_get_line_count (GTK_TEXT_BUFFER (compositor->priv->buffer));
n_digits = get_n_digits (line_count);
- str = g_strnfill (n_digits, '9');
+ str = g_strnfill (n_digits, '9');
pango_layout_set_text (compositor->priv->line_numbers_layout, str, -1);
g_free (str);
@@ -2091,7 +2091,7 @@ calculate_line_numbers_layout_size (GtkSourcePrintCompositor *compositor,
&compositor->priv->line_numbers_height);
DEBUG ({
- g_debug ("line_numbers_width: %f points (%f mm)",
+ g_debug ("line_numbers_width: %f points (%f mm)",
compositor->priv->line_numbers_width,
convert_to_mm (compositor->priv->line_numbers_width, GTK_UNIT_POINTS));
g_debug ("line_numbers_height: %f points (%f mm)",
@@ -2110,10 +2110,10 @@ calculate_header_footer_height (GtkSourcePrintCompositor *compositor,
PangoFontMetrics* font_metrics;
gdouble ascent;
gdouble descent;
-
+
pango_context = gtk_print_context_create_pango_context (context);
pango_context_set_font_description (pango_context, font);
-
+
font_metrics = pango_context_get_metrics (pango_context,
font,
compositor->priv->language);
@@ -2123,10 +2123,10 @@ calculate_header_footer_height (GtkSourcePrintCompositor *compositor,
pango_font_metrics_unref (font_metrics);
g_object_unref (pango_context);
-
+
if (d != NULL)
*d = descent;
-
+
return HEADER_FOOTER_SIZE_FACTOR * (ascent + descent);
}
@@ -2137,30 +2137,30 @@ calculate_header_height (GtkSourcePrintCompositor *compositor,
if (!is_header_to_print(compositor))
{
compositor->priv->header_height = 0.0;
-
+
DEBUG ({
- g_debug ("header_height: %f points (%f mm)",
+ g_debug ("header_height: %f points (%f mm)",
compositor->priv->header_height,
convert_to_mm (compositor->priv->header_height, GTK_UNIT_POINTS));
});
-
+
return;
}
-
+
g_return_if_fail (compositor->priv->header_font != NULL);
-
+
compositor->priv->header_height = calculate_header_footer_height (compositor,
context,
compositor->priv->header_font,
NULL);
DEBUG ({
- g_debug ("header_height: %f points (%f mm)",
+ g_debug ("header_height: %f points (%f mm)",
compositor->priv->header_height,
convert_to_mm (compositor->priv->header_height, GTK_UNIT_POINTS));
- });
+ });
}
-
+
static void
calculate_footer_height (GtkSourcePrintCompositor *compositor,
GtkPrintContext *context)
@@ -2170,25 +2170,25 @@ calculate_footer_height (GtkSourcePrintCompositor *compositor,
compositor->priv->footer_height = 0.0;
DEBUG ({
- g_debug ("footer_height: %f points (%f mm)",
+ g_debug ("footer_height: %f points (%f mm)",
compositor->priv->footer_height,
convert_to_mm (compositor->priv->footer_height, GTK_UNIT_POINTS));
});
-
-
+
+
return;
}
if (compositor->priv->footer_font == NULL)
compositor->priv->footer_font = pango_font_description_copy_static (compositor->priv->body_font);
-
+
compositor->priv->footer_height = calculate_header_footer_height (compositor,
context,
compositor->priv->footer_font,
&compositor->priv->footer_font_descent);
-
+
DEBUG ({
- g_debug ("footer_height: %f points (%f mm)",
+ g_debug ("footer_height: %f points (%f mm)",
compositor->priv->footer_height,
convert_to_mm (compositor->priv->footer_height, GTK_UNIT_POINTS));
});
@@ -2200,17 +2200,17 @@ calculate_page_size_and_margins (GtkSourcePrintCompositor *compositor,
{
GtkPageSetup *page_setup;
- /* calculate_line_numbers_layout_size and calculate_header_footer_height
- functions must be called before calculate_page_size_and_margins */
+ /* calculate_line_numbers_layout_size and calculate_header_footer_height
+ functions must be called before calculate_page_size_and_margins */
g_return_if_fail (compositor->priv->line_numbers_width >= 0.0);
g_return_if_fail (compositor->priv->header_height >= 0.0);
- g_return_if_fail (compositor->priv->footer_height >= 0.0);
-
+ g_return_if_fail (compositor->priv->footer_height >= 0.0);
+
page_setup = gtk_print_context_get_page_setup (context);
compositor->priv->page_margin_top = gtk_page_setup_get_top_margin (page_setup, GTK_UNIT_POINTS);
compositor->priv->page_margin_left = gtk_page_setup_get_left_margin (page_setup, GTK_UNIT_POINTS);
-
+
/* Calculate real margins: the margins specified in the GtkPageSetup object are the "print margins".
they are used to determine the minimal size for the layout margins. */
compositor->priv->real_margin_top = MAX (compositor->priv->page_margin_top,
@@ -2223,7 +2223,7 @@ calculate_page_size_and_margins (GtkSourcePrintCompositor *compositor,
convert_from_mm (compositor->priv->margin_right, GTK_UNIT_POINTS));
DEBUG ({
- g_debug ("real_margin_top: %f points (%f mm)",
+ g_debug ("real_margin_top: %f points (%f mm)",
compositor->priv->real_margin_top,
convert_to_mm (compositor->priv->real_margin_top, GTK_UNIT_POINTS));
g_debug ("real_margin_bottom: %f points (%f mm)",
@@ -2239,11 +2239,11 @@ calculate_page_size_and_margins (GtkSourcePrintCompositor *compositor,
compositor->priv->paper_width = gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_POINTS);
compositor->priv->paper_height = gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_POINTS);
-
+
DEBUG ({
gdouble text_width;
gdouble text_height;
- g_debug ("paper_width: %f points (%f mm)",
+ g_debug ("paper_width: %f points (%f mm)",
compositor->priv->paper_width,
convert_to_mm (compositor->priv->paper_width, GTK_UNIT_POINTS));
g_debug ("paper_heigth: %f points (%f mm)",
@@ -2252,9 +2252,9 @@ calculate_page_size_and_margins (GtkSourcePrintCompositor *compositor,
text_width = get_text_width (compositor);
text_height = get_text_height (compositor);
g_debug ("text_width: %f points (%f mm)", text_width, convert_to_mm (text_width, GTK_UNIT_POINTS));
- g_debug ("text_height: %f points (%f mm)", text_height, convert_to_mm (text_height, GTK_UNIT_POINTS));
-
- });
+ g_debug ("text_height: %f points (%f mm)", text_height, convert_to_mm (text_height, GTK_UNIT_POINTS));
+
+ });
}
/* TODO: maybe we should have a public api to set
@@ -2503,14 +2503,14 @@ set_pango_layouts_width (GtkSourcePrintCompositor *compositor)
/**
* gtk_source_print_compositor_paginate:
* @compositor: a #GtkSourcePrintCompositor.
- * @context: the #GtkPrintContext whose parameters (e.g. paper size, print margins, etc.)
+ * @context: the #GtkPrintContext whose parameters (e.g. paper size, print margins, etc.)
* are used by the the @compositor to paginate the document.
*
* Paginate the document associated with the @compositor.
*
* In order to support non-blocking pagination, document is paginated in small chunks.
- * Each time gtk_source_print_compositor_paginate() is invoked, a chunk of the document
- * is paginated. To paginate the entire document, gtk_source_print_compositor_paginate()
+ * Each time gtk_source_print_compositor_paginate() is invoked, a chunk of the document
+ * is paginated. To paginate the entire document, gtk_source_print_compositor_paginate()
* must be invoked multiple times.
* It returns %TRUE if the document has been completely paginated, otherwise it returns %FALSE.
*
@@ -2519,7 +2519,7 @@ set_pango_layouts_width (GtkSourcePrintCompositor *compositor)
*
* <informalexample><programlisting>
* // Signal handler for the GtkPrintOperation::paginate signal
- *
+ *
* static gboolean
* paginate (GtkPrintOperation *operation,
* GtkPrintContext *context,
@@ -2532,24 +2532,24 @@ set_pango_layouts_width (GtkSourcePrintCompositor *compositor)
* if (gtk_source_print_compositor_paginate (compositor, context))
* {
* gint n_pages;
- *
+ *
* n_pages = gtk_source_print_compositor_get_n_pages (compositor);
* gtk_print_operation_set_n_pages (operation, n_pages);
*
* return TRUE;
* }
- *
+ *
* return FALSE;
* }
* </programlisting></informalexample>
*
- * If you don't need to do pagination in chunks, you can simply do it all in the
+ * If you don't need to do pagination in chunks, you can simply do it all in the
* #GtkPrintOperation::begin-print handler, and set the number of pages from there, like
* in the following example:
*
* <informalexample><programlisting>
* // Signal handler for the GtkPrintOperation::begin-print signal
- *
+ *
* static void
* begin_print (GtkPrintOperation *operation,
* GtkPrintContext *context,
@@ -2561,7 +2561,7 @@ set_pango_layouts_width (GtkSourcePrintCompositor *compositor)
* compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
*
* while (!gtk_source_print_compositor_paginate (compositor, context));
- *
+ *
* n_pages = gtk_source_print_compositor_get_n_pages (compositor);
* gtk_print_operation_set_n_pages (operation, n_pages);
* }
@@ -2574,18 +2574,18 @@ set_pango_layouts_width (GtkSourcePrintCompositor *compositor)
gboolean
gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
GtkPrintContext *context)
-{
+{
GtkTextIter start, end;
gint page_start_offset;
double text_height;
double cur_height;
-
+
gboolean done;
gint pages_count;
g_return_val_if_fail (GTK_SOURCE_IS_PRINT_COMPOSITOR (compositor), TRUE);
g_return_val_if_fail (GTK_IS_PRINT_CONTEXT (context), TRUE);
-
+
if (compositor->priv->state == DONE)
return TRUE;
@@ -2594,10 +2594,10 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
PROFILE ({
if (pagination_timer != NULL)
g_timer_destroy (pagination_timer);
-
+
pagination_timer = g_timer_new ();
});
-
+
g_return_val_if_fail (compositor->priv->pages == NULL, TRUE);
compositor->priv->pages = g_array_new (FALSE, FALSE, sizeof (gint));
@@ -2611,8 +2611,8 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
/* Set layouts width otherwise "aligh right" does not work as expected */
/* Cannot be done when setting up layouts since we need the width */
- set_pango_layouts_width (compositor);
-
+ set_pango_layouts_width (compositor);
+
compositor->priv->state = PAGINATING;
}
@@ -2622,12 +2622,12 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
if (compositor->priv->pagination_mark == NULL)
{
gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER (compositor->priv->buffer), &start);
-
+
compositor->priv->pagination_mark = gtk_text_buffer_create_mark (GTK_TEXT_BUFFER (compositor->priv->buffer),
NULL,
&start,
TRUE);
-
+
/* add the first page start */
page_start_offset = gtk_text_iter_get_offset (&start);
g_array_append_val (compositor->priv->pages, page_start_offset);
@@ -2638,11 +2638,11 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
&start,
compositor->priv->pagination_mark);
}
-
+
DEBUG ({
g_debug ("Start paginating at %d", gtk_text_iter_get_offset (&start));
});
-
+
gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (compositor->priv->buffer), &end);
cur_height = 0;
@@ -2650,13 +2650,13 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
done = gtk_text_iter_compare (&start, &end) >= 0;
pages_count = 0;
-
+
while (!done && (pages_count < PAGINATION_CHUNK_SIZE))
{
gint line_number;
GtkTextIter line_end;
gdouble line_height;
-
+
line_number = gtk_text_iter_get_line (&start);
line_end = start;
@@ -2748,7 +2748,7 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
else
{
page_start_offset = gtk_text_iter_get_offset (&start);
-
+
gtk_text_buffer_move_mark (GTK_TEXT_BUFFER (compositor->priv->buffer),
compositor->priv->pagination_mark,
&start);
@@ -2761,7 +2761,7 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
/* store the start of the new page */
g_array_append_val (compositor->priv->pages,
page_start_offset);
-
+
++pages_count;
}
else
@@ -2769,20 +2769,20 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
cur_height += line_height;
gtk_text_iter_forward_line (&start);
}
-
+
done = gtk_text_iter_compare (&start, &end) >= 0;
}
#undef EPS
- if (done)
+ if (done)
{
- PROFILE ({
+ PROFILE ({
g_debug ("Paginated in %f seconds:\n", g_timer_elapsed (pagination_timer, NULL));
g_timer_destroy (pagination_timer);
pagination_timer = NULL;
});
-
+
DEBUG ({
int i;
@@ -2794,20 +2794,20 @@ gtk_source_print_compositor_paginate (GtkSourcePrintCompositor *compositor,
offset = g_array_index (compositor->priv->pages, int, i);
gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (compositor->priv->buffer), &iter, offset);
- g_debug (" page %d starts at line %d (offset %d)\n", i, gtk_text_iter_get_line (&iter), offset);
+ g_debug (" page %d starts at line %d (offset %d)\n", i, gtk_text_iter_get_line (&iter), offset);
}
});
compositor->priv->state = DONE;
compositor->priv->n_pages = compositor->priv->pages->len;
-
+
/* Remove the pagination mark */
gtk_text_buffer_delete_mark (GTK_TEXT_BUFFER (compositor->priv->buffer),
compositor->priv->pagination_mark);
compositor->priv->pagination_mark = NULL;
}
-
+
return (done != FALSE);
}
@@ -2840,7 +2840,7 @@ gtk_source_print_compositor_get_pagination_progress (GtkSourcePrintCompositor *c
return 1.0;
g_return_val_if_fail (compositor->priv->pagination_mark != NULL, 0.0);
-
+
gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (compositor->priv->buffer),
¤t,
compositor->priv->pagination_mark);
@@ -2850,34 +2850,34 @@ gtk_source_print_compositor_get_pagination_progress (GtkSourcePrintCompositor *c
static void
print_header_string (GtkSourcePrintCompositor *compositor,
- cairo_t *cr,
+ cairo_t *cr,
PangoAlignment alignment,
const gchar *format)
{
gchar *text;
-
+
text = evaluate_format_string (compositor, format);
if (text != NULL)
- {
- PangoLayoutLine* line;
+ {
+ PangoLayoutLine* line;
gdouble baseline;
PangoLayoutIter *iter;
-
+
gdouble layout_width;
- gdouble layout_height;
+ gdouble layout_height;
gdouble header_width;
gdouble x;
-
- header_width = compositor->priv->paper_width -
+
+ header_width = compositor->priv->paper_width -
compositor->priv->real_margin_left -
compositor->priv->real_margin_right;
-
+
pango_layout_set_text (compositor->priv->header_layout, text, -1);
-
+
/* Print only the first line */
iter = pango_layout_get_iter (compositor->priv->header_layout);
baseline = (gdouble) pango_layout_iter_get_baseline (iter) / (gdouble) PANGO_SCALE;
-
+
get_layout_size (compositor->priv->header_layout, &layout_width, &layout_height);
switch (alignment)
@@ -2885,17 +2885,17 @@ print_header_string (GtkSourcePrintCompositor *compositor,
case PANGO_ALIGN_RIGHT:
x = compositor->priv->real_margin_left + header_width - layout_width;
break;
-
+
case PANGO_ALIGN_CENTER:
x = compositor->priv->real_margin_left + header_width / 2 - layout_width / 2;
break;
-
+
case PANGO_ALIGN_LEFT:
default:
x = compositor->priv->real_margin_left;
break;
- }
-
+ }
+
DEBUG ({
cairo_save (cr);
@@ -2914,51 +2914,51 @@ print_header_string (GtkSourcePrintCompositor *compositor,
line = pango_layout_iter_get_line_readonly (iter);
cairo_move_to (cr,
- x,
+ x,
compositor->priv->real_margin_top + baseline);
-
+
pango_cairo_show_layout_line (cr, line);
- pango_layout_iter_free (iter);
+ pango_layout_iter_free (iter);
g_free (text);
}
}
-static void
+static void
print_header (GtkSourcePrintCompositor *compositor,
cairo_t *cr)
{
pango_cairo_update_layout (cr, compositor->priv->header_layout);
-
+
/* left format */
if (compositor->priv->header_format_left != NULL)
- print_header_string (compositor,
- cr,
+ print_header_string (compositor,
+ cr,
PANGO_ALIGN_LEFT,
compositor->priv->header_format_left);
-
+
/* right format */
if (compositor->priv->header_format_right != NULL)
- print_header_string (compositor,
- cr,
+ print_header_string (compositor,
+ cr,
PANGO_ALIGN_RIGHT,
compositor->priv->header_format_right);
/* center format */
- if (compositor->priv->header_format_center != NULL)
- print_header_string (compositor,
- cr,
+ if (compositor->priv->header_format_center != NULL)
+ print_header_string (compositor,
+ cr,
PANGO_ALIGN_CENTER,
compositor->priv->header_format_center);
-
+
/* separator */
if (compositor->priv->header_separator)
{
- gdouble y = compositor->priv->real_margin_top +
+ gdouble y = compositor->priv->real_margin_top +
(1 - SEPARATOR_SPACING_FACTOR) * compositor->priv->header_height;
cairo_save (cr);
-
+
cairo_move_to (cr, compositor->priv->real_margin_left, y);
cairo_set_line_width (cr, SEPARATOR_LINE_WIDTH);
cairo_line_to (cr, compositor->priv->paper_width - compositor->priv->real_margin_right, y);
@@ -2970,26 +2970,26 @@ print_header (GtkSourcePrintCompositor *compositor,
static void
print_footer_string (GtkSourcePrintCompositor *compositor,
- cairo_t *cr,
+ cairo_t *cr,
PangoAlignment alignment,
const gchar *format)
{
gchar *text;
-
+
text = evaluate_format_string (compositor, format);
if (text != NULL)
- {
- PangoLayoutLine* line;
-
+ {
+ PangoLayoutLine* line;
+
gdouble layout_width;
- gdouble layout_height;
+ gdouble layout_height;
gdouble footer_width;
gdouble x;
-
- footer_width = compositor->priv->paper_width -
+
+ footer_width = compositor->priv->paper_width -
compositor->priv->real_margin_left -
compositor->priv->real_margin_right;
-
+
pango_layout_set_text (compositor->priv->footer_layout, text, -1);
get_layout_size (compositor->priv->footer_layout, &layout_width, &layout_height);
@@ -2999,25 +2999,25 @@ print_footer_string (GtkSourcePrintCompositor *compositor,
case PANGO_ALIGN_RIGHT:
x = compositor->priv->real_margin_left + footer_width - layout_width;
break;
-
+
case PANGO_ALIGN_CENTER:
x = compositor->priv->real_margin_left + footer_width / 2 - layout_width / 2;
break;
-
+
case PANGO_ALIGN_LEFT:
default:
x = compositor->priv->real_margin_left;
break;
- }
+ }
/* Print only the first line */
line = pango_layout_get_line (compositor->priv->footer_layout, 0);
DEBUG ({
gdouble w;
gdouble h;
-
+
get_layout_size (compositor->priv->footer_layout, &w, &h);
-
+
cairo_save (cr);
cairo_set_line_width (cr, 1.);
cairo_set_source_rgb (cr, 0., 0., 1.);
@@ -3029,49 +3029,49 @@ print_footer_string (GtkSourcePrintCompositor *compositor,
cairo_stroke (cr);
cairo_restore (cr);
});
-
+
cairo_move_to (cr,
- x,
- compositor->priv->paper_height -
+ x,
+ compositor->priv->paper_height -
compositor->priv->real_margin_bottom - compositor->priv->footer_font_descent);
-
+
pango_cairo_show_layout_line (cr, line);
-
+
g_free (text);
}
}
-static void
+static void
print_footer (GtkSourcePrintCompositor *compositor,
cairo_t *cr)
{
pango_cairo_update_layout (cr, compositor->priv->footer_layout);
-
+
/* left format */
if (compositor->priv->footer_format_left != NULL)
- print_footer_string (compositor,
- cr,
+ print_footer_string (compositor,
+ cr,
PANGO_ALIGN_LEFT,
compositor->priv->footer_format_left);
-
+
/* right format */
if (compositor->priv->footer_format_right != NULL)
- print_footer_string (compositor,
- cr,
+ print_footer_string (compositor,
+ cr,
PANGO_ALIGN_RIGHT,
compositor->priv->footer_format_right);
/* center format */
- if (compositor->priv->footer_format_center != NULL)
- print_footer_string (compositor,
- cr,
+ if (compositor->priv->footer_format_center != NULL)
+ print_footer_string (compositor,
+ cr,
PANGO_ALIGN_CENTER,
compositor->priv->footer_format_center);
-
+
/* separator */
if (compositor->priv->footer_separator)
{
- gdouble y = compositor->priv->paper_height -
+ gdouble y = compositor->priv->paper_height -
compositor->priv->real_margin_bottom -
(1 - SEPARATOR_SPACING_FACTOR) * compositor->priv->footer_height;
@@ -3089,7 +3089,7 @@ print_footer (GtkSourcePrintCompositor *compositor,
/**
* gtk_source_print_compositor_draw_page:
* @compositor: a #GtkSourcePrintCompositor.
- * @context: the #GtkPrintContext encapsulating the context information that is required when
+ * @context: the #GtkPrintContext encapsulating the context information that is required when
* drawing the page for printing.
* @page_nr: the number of the page to print.
*
@@ -3100,7 +3100,7 @@ print_footer (GtkSourcePrintCompositor *compositor,
*
* <informalexample><programlisting>
* // Signal handler for the GtkPrintOperation::draw_page signal
- *
+ *
* static void
* draw_page (GtkPrintOperation *operation,
* GtkPrintContext *context,
@@ -3111,12 +3111,12 @@ print_footer (GtkSourcePrintCompositor *compositor,
*
* compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
*
- * gtk_source_print_compositor_draw_page (compositor,
+ * gtk_source_print_compositor_draw_page (compositor,
* context,
* page_nr);
* }
* </programlisting></informalexample>
- */
+ */
void
gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
GtkPrintContext *context,
@@ -3135,7 +3135,7 @@ gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
cr = gtk_print_context_get_cairo_context (context);
cairo_set_source_rgb (cr, 0, 0, 0);
- cairo_translate (cr,
+ cairo_translate (cr,
-1 * compositor->priv->page_margin_left,
-1 * compositor->priv->page_margin_top);
@@ -3155,25 +3155,25 @@ gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
DEBUG ({
cairo_save (cr);
-
+
cairo_set_line_width (cr, 1.);
cairo_set_source_rgb (cr, 0., 0., 1.);
cairo_rectangle (cr,
- compositor->priv->real_margin_left,
+ compositor->priv->real_margin_left,
compositor->priv->real_margin_top,
- compositor->priv->paper_width -
+ compositor->priv->paper_width -
compositor->priv->real_margin_left - compositor->priv->real_margin_right,
- compositor->priv->paper_height -
+ compositor->priv->paper_height -
compositor->priv->real_margin_top - compositor->priv->real_margin_bottom);
cairo_stroke (cr);
-
+
cairo_set_source_rgb (cr, 1., 0., 0.);
cairo_rectangle (cr,
ln_x, y,
compositor->priv->line_numbers_width,
get_text_height (compositor));
cairo_stroke (cr);
-
+
cairo_set_source_rgb (cr, 0., 1., 0.);
cairo_rectangle (cr,
x, y,
@@ -3187,16 +3187,16 @@ gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
compositor->priv->paper_width,
compositor->priv->paper_height);
cairo_stroke (cr);
-
+
cairo_restore (cr);
});
g_return_if_fail (compositor->priv->layout != NULL);
pango_cairo_update_layout (cr, compositor->priv->layout);
-
- if (compositor->priv->print_line_numbers)
+
+ if (compositor->priv->print_line_numbers)
{
- g_return_if_fail (compositor->priv->line_numbers_layout != NULL);
+ g_return_if_fail (compositor->priv->line_numbers_layout != NULL);
pango_cairo_update_layout (cr, compositor->priv->line_numbers_layout);
}
@@ -3233,13 +3233,13 @@ gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
if (gtk_text_iter_compare (&line_end, &end) > 0)
line_end = end;
- if (gtk_text_iter_starts_line (&start))
+ if (gtk_text_iter_starts_line (&start))
{
line_number = gtk_text_iter_get_line (&start);
}
else
{
- /* This happens only if the first line of the page
+ /* This happens only if the first line of the page
* is the continuation of the last line of the previous page.
* In this case the line numbers must not be print
*/
@@ -3261,7 +3261,7 @@ gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
double ln_baseline_offset;
gchar *str;
- str = g_strdup_printf ("%d", line_number + 1);
+ str = g_strdup_printf ("%d", line_number + 1);
pango_layout_set_text (compositor->priv->line_numbers_layout, str, -1);
g_free (str);
@@ -3283,7 +3283,7 @@ gtk_source_print_compositor_draw_page (GtkSourcePrintCompositor *compositor,
}
cairo_move_to (cr, ln_x, y + ln_baseline_offset);
-
+
g_return_if_fail (compositor->priv->line_numbers_layout != NULL);
pango_cairo_show_layout (cr, compositor->priv->line_numbers_layout);
}
diff --git a/gtksourceview/gtksourceprintcompositor.h b/gtksourceview/gtksourceprintcompositor.h
index 0f1cd83..eeb37f9 100644
--- a/gtksourceview/gtksourceprintcompositor.h
+++ b/gtksourceview/gtksourceprintcompositor.h
@@ -1,25 +1,25 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
* gtksourceprintcompositor.h
- * This file is part of GtkSourceView
+ * This file is part of GtkSourceView
*
- * Copyright (C) 2003 Gustavo GirÃldez
+ * Copyright (C) 2003 Gustavo GirÃldez
* Copyright (C) 2007-2008 Paolo Maggi, Paolo Borelli and Yevgen Muntyan
*
* GtkSourceView is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
+ *
* GtkSourceView is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#ifndef __GTK_SOURCE_PRINT_COMPOSITOR_H__
#define __GTK_SOURCE_PRINT_COMPOSITOR_H__
@@ -52,7 +52,7 @@ struct _GtkSourcePrintCompositorClass
/* Padding for future expansion */
void (*_gtk_source_reserved1) (void);
- void (*_gtk_source_reserved2) (void);
+ void (*_gtk_source_reserved2) (void);
};
@@ -75,7 +75,7 @@ void gtk_source_print_compositor_set_wrap_mode (GtkSourcePrintCompositor *co
GtkWrapMode wrap_mode);
GtkWrapMode gtk_source_print_compositor_get_wrap_mode (GtkSourcePrintCompositor *compositor);
-void gtk_source_print_compositor_set_highlight_syntax
+void gtk_source_print_compositor_set_highlight_syntax
(GtkSourcePrintCompositor *compositor,
gboolean highlight);
gboolean gtk_source_print_compositor_get_highlight_syntax
@@ -172,5 +172,5 @@ G_END_DECLS
#endif /* __GTK_SOURCE_PRINT_COMPOSITOR_H__ */
-
-
+
+
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index 5ab0853..a04fc91 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -39,7 +39,7 @@
* non-highlighted text, color for the line numbers, etc.
*
* Style schemes are stored in XML files. The format of a scheme file is
- * the documented in the
+ * the documented in the
* <link linkend="style-reference">style scheme reference</link>.
*/
diff --git a/gtksourceview/gtksourceundomanager.c b/gtksourceview/gtksourceundomanager.c
index 53c3e4b..e12b696 100644
--- a/gtksourceview/gtksourceundomanager.c
+++ b/gtksourceview/gtksourceundomanager.c
@@ -266,7 +266,7 @@ gtk_source_undo_manager_end_not_undoable_action (GtkSourceUndoManager *manager)
/**
* gtk_source_undo_manager_can_undo_changed:
* @manager: a #GtkSourceUndoManager.
- *
+ *
* Emits the #GtkSourceUndoManager::can-undo-changed signal.
*
* Since: 2.10
@@ -282,7 +282,7 @@ gtk_source_undo_manager_can_undo_changed (GtkSourceUndoManager *manager)
/**
* gtk_source_undo_manager_can_redo_changed:
* @manager: a #GtkSourceUndoManager.
- *
+ *
* Emits the #GtkSourceUndoManager::can-redo-changed signal.
*
* Since: 2.10
diff --git a/gtksourceview/gtksourceundomanagerdefault.c b/gtksourceview/gtksourceundomanagerdefault.c
index 694444c..e5071f6 100644
--- a/gtksourceview/gtksourceundomanagerdefault.c
+++ b/gtksourceview/gtksourceundomanagerdefault.c
@@ -355,7 +355,7 @@ gtk_source_undo_manager_default_set_property (GObject *object,
GParamSpec *pspec)
{
GtkSourceUndoManagerDefault *self = GTK_SOURCE_UNDO_MANAGER_DEFAULT (object);
-
+
switch (prop_id)
{
case PROP_BUFFER:
@@ -378,7 +378,7 @@ gtk_source_undo_manager_default_get_property (GObject *object,
GParamSpec *pspec)
{
GtkSourceUndoManagerDefault *self = GTK_SOURCE_UNDO_MANAGER_DEFAULT (object);
-
+
switch (prop_id)
{
case PROP_BUFFER:
diff --git a/gtksourceview/gtksourceview.h b/gtksourceview/gtksourceview.h
index beb0752..3a8f846 100644
--- a/gtksourceview/gtksourceview.h
+++ b/gtksourceview/gtksourceview.h
@@ -71,7 +71,7 @@ struct _GtkSourceViewClass
void (*undo) (GtkSourceView *view);
void (*redo) (GtkSourceView *view);
- void (*line_mark_activated) (GtkSourceView *view,
+ void (*line_mark_activated) (GtkSourceView *view,
GtkTextIter *iter,
GdkEvent *event);
void (*show_completion) (GtkSourceView *view);
diff --git a/tests/test-completion.c b/tests/test-completion.c
index ad2b27c..3eaaaf2 100644
--- a/tests/test-completion.c
+++ b/tests/test-completion.c
@@ -123,7 +123,7 @@ test_provider_class_init (TestProviderClass *klass)
{
}
-static void
+static void
test_provider_init (TestProvider *self)
{
GList *proposals = NULL;
@@ -181,7 +181,7 @@ toggle_active_property (gpointer source,
const gchar *name)
{
gboolean value;
-
+
g_object_get (source, name, &value, NULL);
g_object_set (dest, "active", value, NULL);
}
@@ -207,39 +207,39 @@ create_window (void)
GtkWidget *show_headers;
GtkWidget *show_icons;
GtkSourceCompletion *completion;
-
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_resize (GTK_WINDOW (window), 600, 400);
-
+
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
-
+
view = gtk_source_view_new ();
GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (scroll), view);
-
+
remember = gtk_check_button_new_with_label ("Remember info visibility");
select_on_show = gtk_check_button_new_with_label ("Select first on show");
show_headers = gtk_check_button_new_with_label ("Show headers");
show_icons = gtk_check_button_new_with_label ("Show icons");
-
+
completion = gtk_source_view_get_completion (GTK_SOURCE_VIEW (view));
-
+
toggle_active_property (completion, remember, "remember-info-visibility");
toggle_active_property (completion, select_on_show, "select-on-show");
toggle_active_property (completion, show_headers, "show-headers");
toggle_active_property (completion, show_icons, "show-icons");
-
+
gtk_box_pack_start (GTK_BOX (hbox), remember, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), select_on_show, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), show_headers, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), show_icons, FALSE, FALSE, 0);
-
+
gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
+
gtk_container_add (GTK_CONTAINER (window), vbox);
-
+
g_signal_connect (window, "destroy",
G_CALLBACK (destroy_cb),
NULL);
@@ -263,15 +263,15 @@ static void
create_completion(void)
{
GtkSourceCompletionWords *prov_words;
-
+
comp = gtk_source_view_get_completion (GTK_SOURCE_VIEW (view));
prov_words = gtk_source_completion_words_new (NULL, NULL);
-
+
gtk_source_completion_words_register (prov_words,
gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)));
-
- gtk_source_completion_add_provider (comp,
- GTK_SOURCE_COMPLETION_PROVIDER (prov_words),
+
+ gtk_source_completion_add_provider (comp,
+ GTK_SOURCE_COMPLETION_PROVIDER (prov_words),
NULL);
g_object_set (prov_words, "priority", 10, NULL);
diff --git a/tests/test-widget.c b/tests/test-widget.c
index 406c13e..256bb1e 100644
--- a/tests/test-widget.c
+++ b/tests/test-widget.c
@@ -1207,7 +1207,7 @@ window_deleted_cb (GtkWidget *widget, GdkEvent *ev, gpointer user_data)
}
static void
-line_mark_activated (GtkSourceGutter *gutter,
+line_mark_activated (GtkSourceGutter *gutter,
GtkTextIter *iter,
GdkEventButton *ev,
GtkSourceView *view)
@@ -1358,7 +1358,7 @@ create_view_window (GtkSourceBuffer *buffer, GtkSourceView *from)
/* view */
view = gtk_source_view_new_with_buffer (buffer);
-
+
if (style_scheme)
gtk_source_buffer_set_style_scheme (buffer, style_scheme);
diff --git a/tests/testregion.c b/tests/testregion.c
index 9545d7f..c6a460c 100644
--- a/tests/testregion.c
+++ b/tests/testregion.c
@@ -10,7 +10,7 @@ main (int argc, char **argv)
GtkTextRegionIterator reg_iter;
GtkTextIter iter1, iter2;
gint i;
-
+
#define NUM_OPS 23
gint ops [NUM_OPS][3] = {
@@ -57,7 +57,7 @@ main (int argc, char **argv)
/* add the subregion we just removed */
{ 1, 10, 15 },
};
-
+
#define NUM_INTERSECTS 5
gint inter [NUM_INTERSECTS][2] = {
@@ -67,9 +67,9 @@ main (int argc, char **argv)
{ 1, 24 },
{ 3, 7 }
};
-
+
gtk_init (&argc, &argv);
-
+
buffer = gtk_text_buffer_new (NULL);
region = gtk_text_region_new (buffer);
@@ -84,7 +84,7 @@ main (int argc, char **argv)
for (i = 0; i < NUM_OPS; i++) {
gchar *op_name;
-
+
gtk_text_buffer_get_iter_at_offset (buffer, &iter1, ops [i][1]);
gtk_text_buffer_get_iter_at_offset (buffer, &iter2, ops [i][2]);
@@ -99,7 +99,7 @@ main (int argc, char **argv)
gtk_text_region_debug_print (region);
}
-
+
for (i = 0; i < NUM_INTERSECTS; i++) {
gtk_text_buffer_get_iter_at_offset (buffer, &iter1, inter [i][0]);
gtk_text_buffer_get_iter_at_offset (buffer, &iter2, inter [i][1]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]