255
251
* gint show_parallel(const gchar * value, const gchar * type,gboolean clicked)
264
static gint show_parallel(const gchar * svalue, const gchar * stype,
260
static gint show_parallel(const gchar * svalue, const gchar * stype,
265
261
gboolean clicked)
267
if(!strcmp(stype,"swap")) {
269
main_swap_parallel_with_main((gchar *) svalue);
263
if (!strcmp(stype,"swap")) {
265
main_swap_parallel_with_main((gchar *) svalue);
271
gchar *buf = g_strdup_printf(
267
gchar *buf = g_strdup_printf(
272
268
_("Show %s in main window"), svalue);
273
269
gui_set_statusbar (buf);
277
if(!strcmp(stype,"verse")) {
273
if (!strcmp(stype,"verse")) {
279
275
gtk_entry_set_text(GTK_ENTRY(navbar_parallel.lookup_entry),svalue);
280
276
gtk_widget_activate(navbar_parallel.lookup_entry);
294
290
* gint show_morph(const gchar * type, const gchar * value, gboolean clicked)
303
static gint show_morph(const gchar * stype, const gchar * svalue,
299
static gint show_morph(const gchar * stype, const gchar * svalue,
304
300
gboolean clicked)
306
302
const gchar *modbuf = NULL;
307
303
gchar *mybuf = NULL;
309
305
if (!strcmp(stype,"Greek") ||
310
306
strstr(stype,"x-Robinson") ||
311
307
strstr(stype,"robinson") ||
312
308
strstr(stype,"Robinson")) {
313
309
if (backend->get_key_testament(settings.currentverse) == 2) {
314
if (backend->is_module("Robinson"))
310
if (backend->is_module("Robinson"))
315
311
modbuf = "Robinson";
317
if (backend->is_module("Packard"))
313
if (backend->is_module("Packard"))
318
314
modbuf = "Packard";
321
317
//GS_message(("modbuf = %s", modbuf));
323
main_display_dictionary(modbuf, (gchar*)svalue);
319
main_display_dictionary(modbuf, (gchar*)svalue);
325
321
mybuf = main_get_rendered_text(modbuf, (gchar*)svalue);
326
322
//GS_message(("mybuf = %s", mybuf));
349
345
* gint show_strongs(const gchar * type, const gchar * value, gboolean clicked)
358
static gint show_strongs(const gchar * stype, const gchar * svalue,
354
static gint show_strongs(const gchar * stype, const gchar * svalue,
359
355
gboolean clicked)
361
357
const gchar *modbuf = NULL;
362
358
gchar *mybuf = NULL;
363
359
gchar *val = NULL;
365
361
val = g_strdup(svalue);
366
/*if((val1 = strchar(val,'|')) != NULL) {
362
/*if ((val1 = strchar(val,'|')) != NULL) {
367
363
val1 = (val1) ? (val1 + 1) : val;
371
if(!strcmp(settings.MainWindowModule,"NASB")) {
372
if(!strcmp(stype,"Greek"))
367
if (!strcmp(settings.MainWindowModule,"NASB")) {
368
if (!strcmp(stype,"Greek"))
373
369
modbuf = "NASGreek";
375
371
modbuf = "NASHebrew";
377
373
if (stype && (*stype != '\0')) {
378
if(!strcmp(stype,"Greek"))
374
if (!strcmp(stype,"Greek"))
379
375
modbuf = settings.lex_greek;
381
377
modbuf = settings.lex_hebrew;
383
379
modbuf = "InvStrongsRealGreek";
387
main_display_dictionary(modbuf, (gchar*)svalue);
383
main_display_dictionary(modbuf, (gchar*)svalue);
389
385
mybuf = main_get_rendered_text(modbuf, (gchar*)svalue);
391
main_information_viewer(
387
main_information_viewer(
414
410
* gint note_uri(const gchar * url)
423
static gint show_note(const gchar * module, const gchar * passage,
419
static gint show_note(const gchar * module, const gchar * passage,
424
420
const gchar * stype, const gchar * svalue, gboolean clicked)
426
422
gchar *tmpbuf = NULL;
427
423
gchar *buf = NULL;
428
424
gchar *work_buf = NULL;
429
425
GString *str = g_string_new(NULL);
430
426
GList *tmp = NULL;
431
427
RESULTS *list_item;
436
if (!backend->is_module((gchar*)module))
432
if (!backend->is_module((gchar*)module))
437
433
module = settings.MainWindowModule;
439
435
if (passage && (strlen(passage) < 5))
440
436
passage = settings.currentverse;
443
439
// if we are asking for a note/xref in n:0,
444
440
// we must stop autonormalization for a moment.
473
} else if(strchr(stype,'n') && !clicked) {
469
} else if (strchr(stype,'n') && !clicked) {
474
470
tmpbuf = backend->get_entry_attribute("Footnote",
477
473
buf = backend->render_this_text((gchar*)module,(gchar*)tmpbuf);
478
if(tmpbuf) g_free(tmpbuf);
474
if (tmpbuf) g_free(tmpbuf);
480
476
main_information_viewer((gchar*)module,
592
588
* #include "main/url.hh"
594
* gint show_module_and_key(const gchar * module, const gchar * key,
590
* gint show_module_and_key(const gchar * module, const gchar * key,
595
591
const gchar * type, gboolean clicked)
605
static int show_module_and_key(const char * module, const char * key,
601
static int show_module_and_key(const char * module, const char * key,
606
602
const char * stype, gboolean clicked)
608
604
gchar *tmpkey = NULL;
611
if (module && (strlen((char*)module) < 3) &&
607
if (module && (strlen((char*)module) < 3) &&
612
608
backend->is_Bible_key(key, settings.currentverse)) {
613
609
module = settings.MainWindowModule;
619
615
if (backend->is_module(module)) {
620
616
if (!strcmp(stype,"newTab")) {
621
main_open_bookmark_in_new_tab((gchar*)module,
617
main_open_bookmark_in_new_tab((gchar*)module,
625
621
if (!strcmp(stype,"newDialog")) {
626
if(module && (main_get_mod_type((gchar*)module) == PERCOM_TYPE)) {
622
if (module && (main_get_mod_type((gchar*)module) == PERCOM_TYPE)) {
627
623
editor_create_new(module,key,TRUE);
634
630
mod_type = backend->module_type((gchar*)module);
635
631
switch (mod_type) {
637
if (strpbrk(key, "-;,")) { // >1 verse marked
638
main_display_verse_list_in_sidebar
639
(settings.currentverse,
640
(gchar*)module, (gchar*)key);
642
tmpkey = main_update_nav_controls(key);
643
main_display_bible(module, tmpkey);
644
main_display_commentary(NULL, tmpkey);
645
main_keep_bibletext_dialog_in_sync((gchar*)tmpkey);
646
if (tmpkey) g_free((gchar*)tmpkey);
647
editor_sync_with_main();
650
633
case COMMENTARY_TYPE:
651
634
case PERCOM_TYPE:
652
635
if (strpbrk(key, "-;,")) { // >1 verse marked
654
637
(settings.currentverse,
655
638
(gchar*)module, (gchar*)key);
657
tmpkey = main_update_nav_controls(key);
658
main_display_bible(NULL, tmpkey);
659
main_display_commentary(module, tmpkey);
660
main_keep_bibletext_dialog_in_sync((gchar*)tmpkey);
661
if (tmpkey) g_free((gchar*)tmpkey);
662
if (gtk_notebook_get_current_page
664
(widgets.notebook_comm_book)) != 0)
665
gtk_notebook_set_current_page(
666
GTK_NOTEBOOK (widgets.
667
notebook_comm_book), 0);
641
g_strdup_printf("sword://%s/%s",
642
(module ? module : ""),
644
sword_uri(url, TRUE);
670
648
case DICTIONARY_TYPE:
675
653
case PRAYERLIST_TYPE:
676
main_display_book((gchar*)module, (gchar*)key);
677
if(gtk_notebook_get_current_page (GTK_NOTEBOOK
678
(widgets.notebook_comm_book))
654
main_display_book((gchar*)module, (gchar*)key);
655
if (gtk_notebook_get_current_page (GTK_NOTEBOOK
656
(widgets.notebook_comm_book))
680
658
gtk_notebook_set_current_page(
681
659
GTK_NOTEBOOK (widgets.
692
670
/******************************************************************************
697
675
* #include "main/url.hh"
699
* gint (const gchar * type, const gchar * value,
677
* gint (const gchar * type, const gchar * value,
700
678
gboolean clicked)
709
687
static gint show_in_previewer(const gchar * url)
712
gchar **work_buf = NULL;
690
gchar **work_buf = NULL;
713
691
gchar *mybuf = NULL;
715
693
work_buf = g_strsplit (url,"/",4);
717
695
mybuf = main_get_rendered_text(work_buf[MODULE], work_buf[KEY]);
720
main_information_viewer(
721
(gchar*)work_buf[MODULE],
723
(gchar*)work_buf[KEY],
698
main_information_viewer(
699
(gchar*)work_buf[MODULE],
701
(gchar*)work_buf[KEY],
794
772
handling_uri = FALSE;
798
tmpkey = work_buf[MODULE];
775
if (!work_buf[KEY]) {
776
tmpkey = work_buf[MODULE];
800
778
tmpkey = work_buf[KEY];
779
if ((settings.special_anchor = strchr(tmpkey, '#')) ||
780
(settings.special_anchor = strchr(tmpkey, '!')))
781
*(settings.special_anchor++) = '\0';
802
783
GS_message(("work_buf: %s, %s",
803
784
work_buf[MODULE],
804
785
(work_buf[KEY] ? work_buf[KEY] : "-null-")));
806
787
verse_count = 1; //backend->is_Bible_key(mykey, settings.currentverse);
807
if(backend->is_module(work_buf[MODULE])) {
788
if (backend->is_module(work_buf[MODULE])) {
808
789
mod_type = backend->module_type(work_buf[MODULE]);
811
792
key = main_update_nav_controls(tmpkey);
793
main_display_bible(work_buf[MODULE], key);
812
794
if (settings.comm_showing)
813
795
main_display_commentary(NULL, key);
814
main_display_bible(work_buf[MODULE], key);
815
796
main_keep_bibletext_dialog_in_sync((gchar*)key);
816
797
editor_sync_with_main();
818
if(key) g_free((gchar*)key);
820
case COMMENTARY_TYPE:
799
if (key) g_free((gchar*)key);
801
case COMMENTARY_TYPE:
802
if (gtk_notebook_get_current_page
804
(widgets.notebook_comm_book)) != 0) {
805
gchar *save = settings.special_anchor;
806
gtk_notebook_set_current_page(
807
GTK_NOTEBOOK (widgets.
808
notebook_comm_book), 0);
809
settings.special_anchor = save;
811
settings.comm_showing = TRUE;
821
812
key = main_update_nav_controls(tmpkey);
822
813
main_display_commentary(work_buf[MODULE],key);
823
814
main_display_bible(NULL, key);
824
815
main_keep_bibletext_dialog_in_sync((gchar*)key);
825
if(key) g_free((gchar*)key);
816
if (key) g_free((gchar*)key);
827
818
case DICTIONARY_TYPE:
828
819
main_display_dictionary(work_buf[MODULE],
832
main_display_book(work_buf[MODULE], tmpkey);
823
if (gtk_notebook_get_current_page
825
(widgets.notebook_comm_book)) != 1) {
826
gchar *save = settings.special_anchor;
827
gtk_notebook_set_current_page(
828
GTK_NOTEBOOK (widgets.
829
notebook_comm_book), 1);
830
settings.special_anchor = save;
832
settings.comm_showing = FALSE;
833
main_display_book(work_buf[MODULE], tmpkey);
835
836
} else { /* module name not found or not given */
837
838
key = main_update_nav_controls(tmpkey);
838
839
/* display in current Bible and Commentary */
839
840
main_display_commentary(NULL, key);
840
841
main_display_bible(NULL, key);
841
842
main_keep_bibletext_dialog_in_sync((gchar*)key);
843
844
editor_sync_with_main();
845
if(key) g_free((gchar*)key);
846
if (key) g_free((gchar*)key);
847
848
alert_url_not_found(url);
850
851
g_strfreev(work_buf);
851
852
settings.addhistoryitem = TRUE;
852
853
handling_uri = FALSE;
923
924
strongs = g_strdup((gchar*)m_url.getParameterValue("lemma"));
924
925
stype = g_strdup((gchar*)m_url.getParameterValue("type"));
925
926
svalue = g_strdup((gchar*)m_url.getParameterValue("value"));
927
928
// XXX gross hack-fix
928
929
// AraSVD is named "Smith & Van Dyke", using a literal '&'.
929
930
// this is technically a Sword bug: Sword should encode it.
930
931
// we work around it here: replace '&' with '+'. *sigh*
931
932
//if (svalue = strstr(, " & "))
932
933
// *(svalue+1) = '-';
934
935
GS_message(("action = %s", action));
935
936
GS_message(("type = %s", stype));
936
937
GS_message(("value = %s", svalue));