~ubuntu-branches/debian/sid/xiphos/sid

« back to all changes in this revision

Viewing changes to src/main/previewer.cc

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2014-07-12 17:08:46 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20140712170846-ja9jzhgt51d3fkrd
Tags: 3.2.2+dfsg1-1
* New upstream release.
* Bump standards version.
* Switch uscan to sf.net redirector.
* Unpack waf in get-orig-source target.
* Bump to debhelper 9.
* Add uuid-dev build-dep.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * Xiphos Bible Study Tool
3
3
 * previewer.cc -
4
4
 *
5
 
 * Copyright (C) 2000-2011 Xiphos Developer Team
 
5
 * Copyright (C) 2000-2014 Xiphos Developer Team
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
29
29
#include <stringmgr.h>
30
30
#include <localemgr.h>
31
31
 
32
 
#ifdef __cplusplus
33
32
extern "C" {
34
 
#endif
35
 
#include <gtkhtml/gtkhtml.h>
36
33
#include "gui/bibletext.h"
37
 
#ifdef __cplusplus
38
34
}
39
 
#endif
 
35
 
40
36
#include <ctype.h>
41
37
#include <time.h>
42
38
#include "gui/widgets.h"
52
48
 
53
49
#include "gui/debug_glib_null.h"
54
50
 
55
 
#define HTML_START      "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"><style type=\"text/css\"><!-- A { text-decoration:none } *[dir=rtl] { text-align: right; } --></style></head>"
 
51
#define HTML_START      "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\
 
52
<style type=\"text/css\"><!-- \
 
53
A { text-decoration:none } \
 
54
*[dir=rtl] { text-align: right;} \
 
55
body {background-color:%s;color:%s;} \
 
56
a:link{color:%s} -->\
 
57
</style></head><body>"
56
58
 
57
59
using namespace std;
58
60
 
97
99
 
98
100
        g_string_printf(str,
99
101
                        HTML_START
100
 
                        "<body bgcolor=\"%s\" text=\"%s\" link=\"%s\">"
101
102
                        "<font color=\"grey\" face=\"%s\" size=\"%+d\"><b>%s</b></font><hr/></body></html>",
102
103
                        settings.bible_bg_color, settings.bible_text_color,
103
104
                        settings.link_color,
168
169
 
169
170
        g_string_printf(tmp_str,
170
171
                        HTML_START
171
 
                        "<body bgcolor=\"%s\" text=\"%s\" link=\"%s\">"
172
172
                        "<font face=\"%s\" size=\"%+d\">",
173
173
                        settings.bible_bg_color, settings.bible_text_color,
174
174
                        settings.link_color,
270
270
            (settings.searchText[0] == '\0')) {
271
271
                return;
272
272
        }
273
 
        GS_message(("%s",settings.searchText));
 
273
        GS_message(("%s", settings.searchText));
 
274
 
274
275
        /* open and close tags */
275
 
#ifdef USE_XIPHOS_HTML
276
276
        sprintf(openstr,
277
277
                "<span style=\"background-color: %s; color: %s\">",
278
278
                settings.highlight_fg, settings.highlight_bg);
279
279
        sprintf(closestr, "</span>");
280
 
#else
281
 
        sprintf(openstr, "<font color=\"%s\"><b>", settings.found_color);
282
 
        sprintf(closestr, "</b></font>");
283
 
#endif /* !USE_XIPHOS_HTML */
 
280
 
284
281
        searchbuf = g_utf8_casefold(g_strdup(settings.searchText),-1);
285
282
        if (g_str_has_prefix(searchbuf, "\"")) {
286
283
                searchbuf = g_strdelimit(searchbuf, "\"", ' ');
425
422
        MOD_FONT *mf = get_font(mod_name);
426
423
 
427
424
        g_string_printf(tmp_str,
428
 
                        HTML_START
429
 
                        "<body bgcolor=\"%s\" text=\"%s\" link=\"%s\">",
 
425
                        HTML_START,
430
426
                        settings.bible_bg_color, settings.bible_text_color,
431
427
                        settings.link_color);
432
428
 
451
447
                } else {
452
448
                        g_string_printf(tmp_str,
453
449
                                        "<a href=\"passagestudy.jsp?action=showModInfo&value=%s&module=%s\">"
454
 
                                        "<font color=\"%s\">[%s]</a></font>[%s]<br />",
 
450
                                        "<font color=\"%s\">[%s]</a></font><br>[%s]<br />",
455
451
                                        backend->module_description(mod_name),
456
452
                                        mod_name,
457
453
                                        settings.link_color,