summaryrefslogtreecommitdiff
path: root/backend/djvu
diff options
context:
space:
mode:
authorLaurent Napias <[email protected]>2019-06-29 10:43:23 +0200
committerraveit65 <[email protected]>2019-07-01 17:07:40 +0200
commitaa24676651f8bd3e8b434f72d5aac98e84c0867d (patch)
tree37693766ecb4733c6061dcc2ddc26954fab5ca01 /backend/djvu
parent6741c5db1e5c48c01b25bb7900dc40d48552925d (diff)
downloadatril-aa24676651f8bd3e8b434f72d5aac98e84c0867d.tar.bz2
atril-aa24676651f8bd3e8b434f72d5aac98e84c0867d.tar.xz
Remove trailing whitespaces
Diffstat (limited to 'backend/djvu')
-rw-r--r--backend/djvu/djvu-document-private.h8
-rw-r--r--backend/djvu/djvu-document.c110
-rw-r--r--backend/djvu/djvu-document.h2
-rw-r--r--backend/djvu/djvu-links.c24
-rw-r--r--backend/djvu/djvu-links.h2
-rw-r--r--backend/djvu/djvu-text-page.c116
-rw-r--r--backend/djvu/djvu-text-page.h6
7 files changed, 134 insertions, 134 deletions
diff --git a/backend/djvu/djvu-document-private.h b/backend/djvu/djvu-document-private.h
index 2ec9b67a..92bc0f6d 100644
--- a/backend/djvu/djvu-document-private.h
+++ b/backend/djvu/djvu-document-private.h
@@ -1,6 +1,6 @@
-/*
+/*
* Declarations used throughout the djvu classes
- *
+ *
* Copyright (C) 2006, Michael Hofmann <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
+
#ifndef __DJVU_DOCUMENT_INTERNAL_H__
#define __DJVU_DOCUMENT_INTERNAL_H__
@@ -41,7 +41,7 @@ struct _DjvuDocument {
};
int djvu_document_get_n_pages (EvDocument *document);
-void djvu_handle_events (DjvuDocument *djvu_document,
+void djvu_handle_events (DjvuDocument *djvu_document,
int wait,
GError **error);
diff --git a/backend/djvu/djvu-document.c b/backend/djvu/djvu-document.c
index 65f7f0f4..b3e41a8d 100644
--- a/backend/djvu/djvu-document.c
+++ b/backend/djvu/djvu-document.c
@@ -75,7 +75,7 @@ ev_djvu_error_quark (void)
static GQuark q = 0;
if (q == 0)
q = g_quark_from_string ("ev-djvu-quark");
-
+
return q;
}
@@ -85,7 +85,7 @@ handle_message (const ddjvu_message_t *msg, GError **error)
switch (msg->m_any.tag) {
case DDJVU_ERROR: {
gchar *error_str;
-
+
if (msg->m_error.filename) {
error_str = g_strdup_printf ("DjvuLibre error: %s:%d",
msg->m_error.filename,
@@ -94,16 +94,16 @@ handle_message (const ddjvu_message_t *msg, GError **error)
error_str = g_strdup_printf ("DjvuLibre error: %s",
msg->m_error.message);
}
-
+
if (error) {
g_set_error_literal (error, EV_DJVU_ERROR, 0, error_str);
} else {
g_warning ("%s", error_str);
}
-
+
g_free (error_str);
return;
- }
+ }
break;
default:
break;
@@ -115,7 +115,7 @@ djvu_handle_events (DjvuDocument *djvu_document, int wait, GError **error)
{
ddjvu_context_t *ctx = djvu_document->d_context;
const ddjvu_message_t *msg;
-
+
if (!ctx)
return;
@@ -162,7 +162,7 @@ djvu_document_load (EvDocument *document,
filename = g_filename_from_uri (uri, NULL, error);
if (!filename)
return FALSE;
-
+
doc = ddjvu_document_create_by_filename (djvu_document->d_context, filename, TRUE);
if (!doc) {
@@ -205,10 +205,10 @@ djvu_document_load (EvDocument *document,
g_free (filename);
ddjvu_document_release (djvu_document->d_document);
djvu_document->d_document = NULL;
-
+
return FALSE;
}
-
+
g_free (djvu_document->uri);
djvu_document->uri = g_strdup (uri);
@@ -223,7 +223,7 @@ djvu_document_load (EvDocument *document,
for (i = 0; i < n_files; i++) {
struct ddjvu_fileinfo_s fileinfo;
gchar *file;
-
+
ddjvu_document_get_fileinfo (djvu_document->d_document,
i, &fileinfo);
@@ -234,7 +234,7 @@ djvu_document_load (EvDocument *document,
if (!g_file_test (file, G_FILE_TEST_EXISTS)) {
missing_files = TRUE;
g_free (file);
-
+
break;
}
g_free (file);
@@ -271,9 +271,9 @@ int
djvu_document_get_n_pages (EvDocument *document)
{
DjvuDocument *djvu_document = DJVU_DOCUMENT (document);
-
+
g_return_val_if_fail (djvu_document->d_document, 0);
-
+
return ddjvu_document_get_pagenum (djvu_document->d_document);
}
@@ -285,14 +285,14 @@ document_get_page_size (DjvuDocument *djvu_document,
{
ddjvu_pageinfo_t info;
ddjvu_status_t r;
-
+
while ((r = ddjvu_document_get_pageinfo(djvu_document->d_document, page, &info)) < DDJVU_JOB_OK)
djvu_handle_events(djvu_document, TRUE, NULL);
-
+
if (r >= DDJVU_JOB_FAILED)
djvu_handle_events(djvu_document, TRUE, NULL);
- *width = info.width * SCALE_FACTOR;
+ *width = info.width * SCALE_FACTOR;
*height = info.height * SCALE_FACTOR;
}
@@ -311,7 +311,7 @@ djvu_document_get_page_size (EvDocument *document,
}
static cairo_surface_t *
-djvu_document_render (EvDocument *document,
+djvu_document_render (EvDocument *document,
EvRenderContext *rc)
{
DjvuDocument *djvu_document = DJVU_DOCUMENT (document);
@@ -325,31 +325,31 @@ djvu_document_render (EvDocument *document,
double page_width, page_height, tmp;
d_page = ddjvu_page_create_by_pageno (djvu_document->d_document, rc->page->index);
-
+
while (!ddjvu_page_decoding_done (d_page))
djvu_handle_events(djvu_document, TRUE, NULL);
page_width = ddjvu_page_get_width (d_page) * rc->scale * SCALE_FACTOR + 0.5;
page_height = ddjvu_page_get_height (d_page) * rc->scale * SCALE_FACTOR + 0.5;
-
+
switch (rc->rotation) {
case 90:
rotation = DDJVU_ROTATE_90;
tmp = page_height;
page_height = page_width;
page_width = tmp;
-
+
break;
case 180:
rotation = DDJVU_ROTATE_180;
-
+
break;
case 270:
rotation = DDJVU_ROTATE_270;
tmp = page_height;
page_height = page_width;
page_width = tmp;
-
+
break;
default:
rotation = DDJVU_ROTATE_0;
@@ -367,7 +367,7 @@ djvu_document_render (EvDocument *document,
rrect = prect;
ddjvu_page_set_rotation (d_page, rotation);
-
+
ddjvu_page_render (d_page, DDJVU_RENDER_COLOR,
&prect,
&rrect,
@@ -387,18 +387,18 @@ djvu_document_finalize (GObject *object)
if (djvu_document->d_document)
ddjvu_document_release (djvu_document->d_document);
-
+
if (djvu_document->opts)
g_string_free (djvu_document->opts, TRUE);
if (djvu_document->ps_filename)
g_free (djvu_document->ps_filename);
-
+
ddjvu_context_release (djvu_document->d_context);
ddjvu_format_release (djvu_document->d_format);
ddjvu_format_release (djvu_document->thumbs_format);
g_free (djvu_document->uri);
-
+
G_OBJECT_CLASS (djvu_document_parent_class)->finalize (object);
}
@@ -432,7 +432,7 @@ djvu_text_copy (DjvuDocument *djvu_document,
if (page_text != miniexp_nil) {
DjvuTextPage *page = djvu_text_page_new (page_text);
-
+
text = djvu_text_page_copy (page, rectangle);
djvu_text_page_free (page);
ddjvu_miniexp_release (djvu_document->d_document, page_text);
@@ -451,19 +451,19 @@ djvu_selection_get_selected_text (EvSelection *selection,
double width, height;
EvRectangle rectangle;
gchar *text;
-
+
djvu_document_get_page_size (EV_DOCUMENT (djvu_document),
page, &width, &height);
rectangle.x1 = points->x1 / SCALE_FACTOR;
rectangle.y1 = (height - points->y2) / SCALE_FACTOR;
rectangle.x2 = points->x2 / SCALE_FACTOR;
rectangle.y2 = (height - points->y1) / SCALE_FACTOR;
-
+
text = djvu_text_copy (djvu_document, page->index, &rectangle);
-
+
if (text == NULL)
text = g_strdup ("");
-
+
return text;
}
@@ -475,13 +475,13 @@ djvu_selection_iface_init (EvSelectionInterface *iface)
static void
djvu_document_thumbnails_get_dimensions (EvDocumentThumbnails *document,
- EvRenderContext *rc,
+ EvRenderContext *rc,
gint *width,
gint *height)
{
- DjvuDocument *djvu_document = DJVU_DOCUMENT (document);
+ DjvuDocument *djvu_document = DJVU_DOCUMENT (document);
gdouble page_width, page_height;
-
+
djvu_document_get_page_size (EV_DOCUMENT(djvu_document), rc->page,
&page_width, &page_height);
@@ -504,12 +504,12 @@ djvu_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
gdouble page_width, page_height;
gint thumb_width, thumb_height;
guchar *pixels;
-
+
g_return_val_if_fail (djvu_document->d_document, NULL);
djvu_document_get_page_size (EV_DOCUMENT(djvu_document), rc->page,
&page_width, &page_height);
-
+
thumb_width = (gint) (page_width * rc->scale);
thumb_height = (gint) (page_height * rc->scale);
@@ -517,14 +517,14 @@ djvu_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
thumb_width, thumb_height);
gdk_pixbuf_fill (pixbuf, 0xffffffff);
pixels = gdk_pixbuf_get_pixels (pixbuf);
-
+
while (ddjvu_thumbnail_status (djvu_document->d_document, rc->page->index, 1) < DDJVU_JOB_OK)
djvu_handle_events(djvu_document, TRUE, NULL);
-
- ddjvu_thumbnail_render (djvu_document->d_document, rc->page->index,
+
+ ddjvu_thumbnail_render (djvu_document->d_document, rc->page->index,
&thumb_width, &thumb_height,
djvu_document->thumbs_format,
- gdk_pixbuf_get_rowstride (pixbuf),
+ gdk_pixbuf_get_rowstride (pixbuf),
(gchar *)pixels);
rotated_pixbuf = gdk_pixbuf_rotate_simple (pixbuf, 360 - rc->rotation);
@@ -532,11 +532,11 @@ djvu_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
if (border) {
GdkPixbuf *tmp_pixbuf = rotated_pixbuf;
-
+
rotated_pixbuf = ev_document_misc_get_thumbnail_frame (-1, -1, tmp_pixbuf);
g_object_unref (tmp_pixbuf);
}
-
+
return rotated_pixbuf;
}
@@ -553,9 +553,9 @@ djvu_document_file_exporter_begin (EvFileExporter *exporter,
EvFileExporterContext *fc)
{
DjvuDocument *djvu_document = DJVU_DOCUMENT (exporter);
-
+
if (djvu_document->ps_filename)
- g_free (djvu_document->ps_filename);
+ g_free (djvu_document->ps_filename);
djvu_document->ps_filename = g_strdup (fc->filename);
g_string_assign (djvu_document->opts, "-page=");
@@ -566,14 +566,14 @@ djvu_document_file_exporter_do_page (EvFileExporter *exporter,
EvRenderContext *rc)
{
DjvuDocument *djvu_document = DJVU_DOCUMENT (exporter);
-
- g_string_append_printf (djvu_document->opts, "%d,", (rc->page->index) + 1);
+
+ g_string_append_printf (djvu_document->opts, "%d,", (rc->page->index) + 1);
}
static void
djvu_document_file_exporter_end (EvFileExporter *exporter)
{
- int d_optc = 1;
+ int d_optc = 1;
const char *d_optv[d_optc];
DjvuDocument *djvu_document = DJVU_DOCUMENT (exporter);
@@ -583,15 +583,15 @@ djvu_document_file_exporter_end (EvFileExporter *exporter)
g_warning ("Cannot open file ā€œ%sā€.", djvu_document->ps_filename);
return;
}
-
- d_optv[0] = djvu_document->opts->str;
+
+ d_optv[0] = djvu_document->opts->str;
ddjvu_job_t * job = ddjvu_document_print(djvu_document->d_document, fn, d_optc, d_optv);
- while (!ddjvu_job_done(job)) {
+ while (!ddjvu_job_done(job)) {
djvu_handle_events (djvu_document, TRUE, NULL);
}
- fclose(fn);
+ fclose(fn);
}
static EvFileExporterCapabilities
@@ -617,7 +617,7 @@ static void
djvu_document_init (DjvuDocument *djvu_document)
{
guint masks[4] = { 0xff0000, 0xff00, 0xff, 0xff000000 };
-
+
djvu_document->d_context = ddjvu_context_create ("Atril");
djvu_document->d_format = ddjvu_format_create (DDJVU_FORMAT_RGBMASK32, 4, masks);
ddjvu_format_set_row_order (djvu_document->d_format, 1);
@@ -627,7 +627,7 @@ djvu_document_init (DjvuDocument *djvu_document)
djvu_document->ps_filename = NULL;
djvu_document->opts = g_string_new ("");
-
+
djvu_document->d_document = NULL;
}
@@ -651,7 +651,7 @@ djvu_document_find_find_text (EvDocumentFind *document,
if (page_text != miniexp_nil) {
DjvuTextPage *tpage = djvu_text_page_new (page_text);
-
+
djvu_text_page_prepare_search (tpage, case_sensitive);
if (tpage->links->len > 0) {
djvu_text_page_search (tpage, text, case_sensitive);
@@ -675,7 +675,7 @@ djvu_document_find_find_text (EvDocumentFind *document,
r->y1 = height - r->y2 * SCALE_FACTOR;
r->y2 = height - tmp * SCALE_FACTOR;
}
-
+
return matches;
}
diff --git a/backend/djvu/djvu-document.h b/backend/djvu/djvu-document.h
index 76ec8765..72f01ba5 100644
--- a/backend/djvu/djvu-document.h
+++ b/backend/djvu/djvu-document.h
@@ -32,7 +32,7 @@ typedef struct _DjvuDocument DjvuDocument;
GType djvu_document_get_type (void) G_GNUC_CONST;
G_MODULE_EXPORT GType register_atril_backend (GTypeModule *module);
-
+
G_END_DECLS
#endif /* __DJVU_DOCUMENT_H__ */
diff --git a/backend/djvu/djvu-links.c b/backend/djvu/djvu-links.c
index 5999ebcd..da871dac 100644
--- a/backend/djvu/djvu-links.c
+++ b/backend/djvu/djvu-links.c
@@ -176,12 +176,12 @@ build_tree (const DjvuDocument *djvu_document,
iter = miniexp_cdr (iter);
} else if ( miniexp_length (iter) >= 2 ) {
gchar *utf8_title = NULL;
-
+
/* An entry */
if (!string_from_miniexp (miniexp_car (iter), &title)) goto unknown_entry;
if (!string_from_miniexp (miniexp_cadr (iter), &link_dest)) goto unknown_entry;
-
+
if (!g_utf8_validate (title, -1, NULL)) {
utf8_title = str_to_utf8 (title);
title_markup = g_markup_escape_text (utf8_title, -1);
@@ -190,7 +190,7 @@ build_tree (const DjvuDocument *djvu_document,
}
ev_action = get_djvu_link_action (djvu_document, link_dest, -1);
-
+
if (g_str_has_suffix (link_dest, ".djvu")) {
/* FIXME: component file identifiers */
} else if (ev_action) {
@@ -236,7 +236,7 @@ get_djvu_hyperlink_area (ddjvu_pageinfo_t *page_info,
miniexp_t iter;
iter = sexp;
-
+
if ((miniexp_car (iter) == miniexp_symbol ("rect") || miniexp_car (iter) == miniexp_symbol ("oval"))
&& miniexp_length (iter) == 5) {
/* FIXME: get bounding box for (oval) since Atril doesn't support shaped links */
@@ -257,7 +257,7 @@ get_djvu_hyperlink_area (ddjvu_pageinfo_t *page_info,
ev_link_mapping->area.y2 = (page_info->height - miny);
} else if (miniexp_car (iter) == miniexp_symbol ("poly")
&& miniexp_length (iter) >= 5 && miniexp_length (iter) % 2 == 1) {
-
+
/* FIXME: get bounding box since Atril doesn't support shaped links */
int minx = G_MAXINT, miny = G_MAXINT;
int maxx = G_MININT, maxy = G_MININT;
@@ -287,7 +287,7 @@ get_djvu_hyperlink_area (ddjvu_pageinfo_t *page_info,
}
return TRUE;
-
+
unknown_link:
g_warning("DjvuLibre error: Unknown hyperlink area %s", miniexp_to_name(miniexp_car(sexp)));
return FALSE;
@@ -333,7 +333,7 @@ get_djvu_hyperlink_mapping (DjvuDocument *djvu_document,
if (!ev_action) goto unknown_mapping;
ev_link_mapping->data = ev_link_new (comment, ev_action);
-
+
return ev_link_mapping;
unknown_mapping:
@@ -356,7 +356,7 @@ djvu_links_has_document_links (EvDocumentLinks *document_links)
ddjvu_miniexp_release (djvu_document->d_document, outline);
return TRUE;
}
-
+
return FALSE;
}
@@ -395,7 +395,7 @@ djvu_links_get_links (EvDocumentLinks *document_links,
}
ddjvu_miniexp_release (djvu_document->d_document, page_annotations);
}
-
+
return ev_mapping_list_new (page, retval, (GDestroyNotify)g_object_unref);
}
@@ -405,13 +405,13 @@ djvu_links_find_link_dest (EvDocumentLinks *document_links,
{
DjvuDocument *djvu_document = DJVU_DOCUMENT (document_links);
EvLinkDest *ev_dest = NULL;
-
+
ev_dest = get_djvu_link_dest (djvu_document, link_name, -1);
if (!ev_dest) {
g_warning ("DjvuLibre error: unknown link destination %s", link_name);
}
-
+
return ev_dest;
}
@@ -451,6 +451,6 @@ djvu_links_get_links_model (EvDocumentLinks *document_links)
ddjvu_miniexp_release (djvu_document->d_document, outline);
}
-
+
return model;
}
diff --git a/backend/djvu/djvu-links.h b/backend/djvu/djvu-links.h
index 6cacdd36..151db677 100644
--- a/backend/djvu/djvu-links.h
+++ b/backend/djvu/djvu-links.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2006 Pauli Virtanen <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
diff --git a/backend/djvu/djvu-text-page.c b/backend/djvu/djvu-text-page.c
index d74a3983..90bce25e 100644
--- a/backend/djvu/djvu-text-page.c
+++ b/backend/djvu/djvu-text-page.c
@@ -29,13 +29,13 @@
* @page: #DjvuTextPage instance
* @p: s-expression to append
* @delimit: character/word/... delimiter
- *
+ *
* Appends the string in @p to the page text.
- *
+ *
* Returns: whether the end was not reached in this s-expression
*/
static gboolean
-djvu_text_page_selection_process (DjvuTextPage *page,
+djvu_text_page_selection_process (DjvuTextPage *page,
miniexp_t p,
int delimit)
{
@@ -43,7 +43,7 @@ djvu_text_page_selection_process (DjvuTextPage *page,
char *token_text = (char *) miniexp_to_str (miniexp_nth (5, p));
if (page->text) {
char *new_text =
- g_strjoin (delimit & 2 ? "\n" :
+ g_strjoin (delimit & 2 ? "\n" :
delimit & 1 ? " " : NULL,
page->text, token_text,
NULL);
@@ -51,7 +51,7 @@ djvu_text_page_selection_process (DjvuTextPage *page,
page->text = new_text;
} else
page->text = g_strdup (token_text);
- if (p == page->end)
+ if (p == page->end)
return FALSE;
}
return TRUE;
@@ -62,24 +62,24 @@ djvu_text_page_selection_process (DjvuTextPage *page,
* @page: #DjvuTextPage instance
* @p: tree to append
* @delimit: character/word/... delimiter
- *
+ *
* Walks the tree in @p and appends the text with
- * djvu_text_page_selection_process() for all s-expressions
+ * djvu_text_page_selection_process() for all s-expressions
* between the start and end fields.
- *
+ *
* Returns: whether the end was not reached in this subtree
*/
static gboolean
-djvu_text_page_selection (DjvuTextPage *page,
+djvu_text_page_selection (DjvuTextPage *page,
miniexp_t p,
int delimit)
{
g_return_val_if_fail (miniexp_consp (p) && miniexp_symbolp
(miniexp_car (p)), FALSE);
- if (miniexp_car (p) != page->char_symbol)
+ if (miniexp_car (p) != page->char_symbol)
delimit |= miniexp_car (p) == page->word_symbol ? 1 : 2;
-
+
miniexp_t deeper = miniexp_cddr (miniexp_cdddr (p));
while (deeper != miniexp_nil) {
miniexp_t str = miniexp_car (deeper);
@@ -100,11 +100,11 @@ djvu_text_page_selection (DjvuTextPage *page,
static void
djvu_text_page_limits_process (DjvuTextPage *page,
- miniexp_t p,
+ miniexp_t p,
EvRectangle *rect)
{
EvRectangle current;
-
+
current.x1 = miniexp_to_int (miniexp_nth (1, p));
current.y1 = miniexp_to_int (miniexp_nth (2, p));
current.x2 = miniexp_to_int (miniexp_nth (3, p));
@@ -120,10 +120,10 @@ djvu_text_page_limits_process (DjvuTextPage *page,
static void
djvu_text_page_limits (DjvuTextPage *page,
- miniexp_t p,
+ miniexp_t p,
EvRectangle *rect)
{
- g_return_if_fail (miniexp_consp (p) &&
+ g_return_if_fail (miniexp_consp (p) &&
miniexp_symbolp (miniexp_car (p)));
miniexp_t deeper = miniexp_cddr (miniexp_cdddr (p));
@@ -139,20 +139,20 @@ djvu_text_page_limits (DjvuTextPage *page,
}
char *
-djvu_text_page_copy (DjvuTextPage *page,
+djvu_text_page_copy (DjvuTextPage *page,
EvRectangle *rectangle)
{
char* text;
-
+
page->start = miniexp_nil;
page->end = miniexp_nil;
djvu_text_page_limits (page, page->text_structure, rectangle);
djvu_text_page_selection (page, page->text_structure, 0);
-
- /* Do not free the string */
+
+ /* Do not free the string */
text = page->text;
page->text = NULL;
-
+
return text;
}
@@ -160,14 +160,14 @@ djvu_text_page_copy (DjvuTextPage *page,
* djvu_text_page_position:
* @page: #DjvuTextPage instance
* @position: index in the page text
- *
- * Returns the closest s-expression that contains the given position in
+ *
+ * Returns the closest s-expression that contains the given position in
* the page text.
- *
+ *
* Returns: closest s-expression
*/
static miniexp_t
-djvu_text_page_position (DjvuTextPage *page,
+djvu_text_page_position (DjvuTextPage *page,
int position)
{
GArray *links = page->links;
@@ -197,12 +197,12 @@ djvu_text_page_position (DjvuTextPage *page,
* djvu_text_page_union:
* @target: first rectangle and result
* @source: second rectangle
- *
- * Calculates the bounding box of two rectangles and stores the reuslt
+ *
+ * Calculates the bounding box of two rectangles and stores the reuslt
* in the first.
*/
static void
-djvu_text_page_union (EvRectangle *target,
+djvu_text_page_union (EvRectangle *target,
EvRectangle *source)
{
if (source->x1 < target->x1)
@@ -221,15 +221,15 @@ djvu_text_page_union (EvRectangle *target,
* @p: s-expression to append
* @start: first s-expression in the selection
* @end: last s-expression in the selection
- *
+ *
* Appends the rectangle defined by @p to the internal bounding box rectangle.
- *
+ *
* Returns: whether the end was not reached in this s-expression
*/
static gboolean
-djvu_text_page_sexpr_process (DjvuTextPage *page,
+djvu_text_page_sexpr_process (DjvuTextPage *page,
miniexp_t p,
- miniexp_t start,
+ miniexp_t start,
miniexp_t end)
{
if (page->bounding_box || p == start) {
@@ -256,16 +256,16 @@ djvu_text_page_sexpr_process (DjvuTextPage *page,
* @p: tree to append
* @start: first s-expression in the selection
* @end: last s-expression in the selection
- *
- * Walks the tree in @p and extends the rectangle with
+ *
+ * Walks the tree in @p and extends the rectangle with
* djvu_text_page_process() for all s-expressions between @start and @end.
- *
+ *
* Returns: whether the end was not reached in this subtree
*/
static gboolean
-djvu_text_page_sexpr (DjvuTextPage *page,
+djvu_text_page_sexpr (DjvuTextPage *page,
miniexp_t p,
- miniexp_t start,
+ miniexp_t start,
miniexp_t end)
{
g_return_val_if_fail (miniexp_consp (p) && miniexp_symbolp
@@ -293,12 +293,12 @@ djvu_text_page_sexpr (DjvuTextPage *page,
* @page: #DjvuTextPage instance
* @start: first s-expression in the selection
* @end: last s-expression in the selection
- *
+ *
* Builds a rectangle that contains all s-expressions in the given range.
*/
static EvRectangle *
djvu_text_page_box (DjvuTextPage *page,
- miniexp_t start,
+ miniexp_t start,
miniexp_t end)
{
page->bounding_box = NULL;
@@ -312,22 +312,22 @@ djvu_text_page_box (DjvuTextPage *page,
* @p: tree to append
* @case_sensitive: do not ignore case
* @delimit: insert spaces because of higher (sentence/paragraph/...) break
- *
- * Appends the tree in @p to the internal text string.
+ *
+ * Appends the tree in @p to the internal text string.
*/
static void
djvu_text_page_append_text (DjvuTextPage *page,
- miniexp_t p,
- gboolean case_sensitive,
+ miniexp_t p,
+ gboolean case_sensitive,
gboolean delimit)
{
char *token_text;
-
- g_return_if_fail (miniexp_consp (p) &&
+
+ g_return_if_fail (miniexp_consp (p) &&
miniexp_symbolp (miniexp_car (p)));
delimit |= page->char_symbol != miniexp_car (p);
-
+
miniexp_t deeper = miniexp_cddr (miniexp_cdddr (p));
while (deeper != miniexp_nil) {
miniexp_t data = miniexp_car (deeper);
@@ -354,7 +354,7 @@ djvu_text_page_append_text (DjvuTextPage *page,
if (!case_sensitive)
g_free (token_text);
} else
- djvu_text_page_append_text (page, data,
+ djvu_text_page_append_text (page, data,
case_sensitive, delimit);
delimit = FALSE;
deeper = miniexp_cdr (deeper);
@@ -366,12 +366,12 @@ djvu_text_page_append_text (DjvuTextPage *page,
* @page: #DjvuTextPage instance
* @text: text to search
* @case_sensitive: do not ignore case
- *
- * Searches the page for the given text. The results list has to be
+ *
+ * Searches the page for the given text. The results list has to be
* externally freed afterwards.
*/
-void
-djvu_text_page_search (DjvuTextPage *page,
+void
+djvu_text_page_search (DjvuTextPage *page,
const char *text,
gboolean case_sensitive)
{
@@ -409,23 +409,23 @@ djvu_text_page_search (DjvuTextPage *page,
* djvu_text_page_prepare_search:
* @page: #DjvuTextPage instance
* @case_sensitive: do not ignore case
- *
+ *
* Indexes the page text and prepares the page for subsequent searches.
*/
void
djvu_text_page_prepare_search (DjvuTextPage *page,
gboolean case_sensitive)
{
- djvu_text_page_append_text (page, page->text_structure,
- case_sensitive, FALSE);
+ djvu_text_page_append_text (page, page->text_structure,
+ case_sensitive, FALSE);
}
/**
* djvu_text_page_new:
* @text: S-expression of the page text
- *
- * Creates a new page to search.
- *
+ *
+ * Creates a new page to search.
+ *
* Returns: new #DjvuTextPage instance
*/
DjvuTextPage *
@@ -444,10 +444,10 @@ djvu_text_page_new (miniexp_t text)
/**
* djvu_text_page_free:
* @page: #DjvuTextPage instance
- *
+ *
* Frees the given #DjvuTextPage instance.
*/
-void
+void
djvu_text_page_free (DjvuTextPage *page)
{
g_free (page->text);
diff --git a/backend/djvu/djvu-text-page.h b/backend/djvu/djvu-text-page.h
index 5ee85a3e..a25284f5 100644
--- a/backend/djvu/djvu-text-page.h
+++ b/backend/djvu/djvu-text-page.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (C) 2006 Michael Hofmann <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
@@ -46,11 +46,11 @@ struct _DjvuTextLink {
miniexp_t pair;
};
-char * djvu_text_page_copy (DjvuTextPage *page,
+char * djvu_text_page_copy (DjvuTextPage *page,
EvRectangle *rectangle);
void djvu_text_page_prepare_search (DjvuTextPage *page,
gboolean case_sensitive);
-void djvu_text_page_search (DjvuTextPage *page,
+void djvu_text_page_search (DjvuTextPage *page,
const char *text,
gboolean case_sensitive);
DjvuTextPage* djvu_text_page_new (miniexp_t text);