Lines 482-487
Link Here
|
482 |
*charsDeleted = nDeleted; |
482 |
*charsDeleted = nDeleted; |
483 |
} |
483 |
} |
484 |
|
484 |
|
|
|
485 |
|
486 |
#if 0 |
485 |
void Fl_Text_Buffer_mod::overlay_rectangular(int startPos, int rectStart, |
487 |
void Fl_Text_Buffer_mod::overlay_rectangular(int startPos, int rectStart, |
486 |
int rectEnd, const char *text, |
488 |
int rectEnd, const char *text, |
487 |
int *charsInserted, |
489 |
int *charsInserted, |
Lines 507-513
Link Here
|
507 |
if (charsDeleted != NULL) |
509 |
if (charsDeleted != NULL) |
508 |
*charsDeleted = nDeleted; |
510 |
*charsDeleted = nDeleted; |
509 |
} |
511 |
} |
|
|
512 |
#endif |
510 |
|
513 |
|
|
|
514 |
#if 0 |
511 |
void Fl_Text_Buffer_mod::replace_rectangular(int start, int end, int rectStart, |
515 |
void Fl_Text_Buffer_mod::replace_rectangular(int start, int end, int rectStart, |
512 |
int rectEnd, const char *text) |
516 |
int rectEnd, const char *text) |
513 |
{ |
517 |
{ |
Lines 564-570
Link Here
|
564 |
if (nInsertedLines < nDeletedLines) |
568 |
if (nInsertedLines < nDeletedLines) |
565 |
free((void *) insText); |
569 |
free((void *) insText); |
566 |
} |
570 |
} |
|
|
571 |
#endif |
567 |
|
572 |
|
|
|
573 |
#if 0 |
568 |
void Fl_Text_Buffer_mod::remove_rectangular(int start, int end, int rectStart, |
574 |
void Fl_Text_Buffer_mod::remove_rectangular(int start, int end, int rectStart, |
569 |
int rectEnd) |
575 |
int rectEnd) |
570 |
{ |
576 |
{ |
Lines 579-585
Link Here
|
579 |
call_modify_callbacks(start, end - start, nInserted, 0, deletedText); |
585 |
call_modify_callbacks(start, end - start, nInserted, 0, deletedText); |
580 |
free((void *) deletedText); |
586 |
free((void *) deletedText); |
581 |
} |
587 |
} |
|
|
588 |
#endif |
582 |
|
589 |
|
|
|
590 |
#if 0 |
583 |
void Fl_Text_Buffer_mod::clear_rectangular(int start, int end, int rectStart, |
591 |
void Fl_Text_Buffer_mod::clear_rectangular(int start, int end, int rectStart, |
584 |
int rectEnd) |
592 |
int rectEnd) |
585 |
{ |
593 |
{ |
Lines 593-598
Link Here
|
593 |
NULL, NULL); |
601 |
NULL, NULL); |
594 |
free((void *) newlineString); |
602 |
free((void *) newlineString); |
595 |
} |
603 |
} |
|
|
604 |
#endif |
596 |
|
605 |
|
597 |
char *Fl_Text_Buffer_mod::text_in_rectangle(int start, int end, |
606 |
char *Fl_Text_Buffer_mod::text_in_rectangle(int start, int end, |
598 |
int rectStart, |
607 |
int rectStart, |
Lines 659-664
Link Here
|
659 |
redisplay_selection(&oldSelection, &mPrimary); |
668 |
redisplay_selection(&oldSelection, &mPrimary); |
660 |
} |
669 |
} |
661 |
|
670 |
|
|
|
671 |
#if 0 |
662 |
void Fl_Text_Buffer_mod::select_rectangular(int start, int end, int rectStart, |
672 |
void Fl_Text_Buffer_mod::select_rectangular(int start, int end, int rectStart, |
663 |
int rectEnd) |
673 |
int rectEnd) |
664 |
{ |
674 |
{ |
Lines 667-684
Link Here
|
667 |
mPrimary.set_rectangular(start, end, rectStart, rectEnd); |
677 |
mPrimary.set_rectangular(start, end, rectStart, rectEnd); |
668 |
redisplay_selection(&oldSelection, &mPrimary); |
678 |
redisplay_selection(&oldSelection, &mPrimary); |
669 |
} |
679 |
} |
|
|
680 |
#endif |
670 |
|
681 |
|
671 |
int Fl_Text_Buffer_mod::selection_position(int *start, int *end) |
682 |
int Fl_Text_Buffer_mod::selection_position(int *start, int *end) |
672 |
{ |
683 |
{ |
673 |
return mPrimary.position(start, end); |
684 |
return mPrimary.position(start, end); |
674 |
} |
685 |
} |
675 |
|
686 |
|
|
|
687 |
#if 0 |
676 |
int Fl_Text_Buffer_mod::selection_position(int *start, int *end, |
688 |
int Fl_Text_Buffer_mod::selection_position(int *start, int *end, |
677 |
int *isRect, int *rectStart, |
689 |
int *isRect, int *rectStart, |
678 |
int *rectEnd) |
690 |
int *rectEnd) |
679 |
{ |
691 |
{ |
680 |
return mPrimary.position(start, end, isRect, rectStart, rectEnd); |
692 |
return mPrimary.position(start, end, isRect, rectStart, rectEnd); |
681 |
} |
693 |
} |
|
|
694 |
#endif |
682 |
|
695 |
|
683 |
char *Fl_Text_Buffer_mod::selection_text() |
696 |
char *Fl_Text_Buffer_mod::selection_text() |
684 |
{ |
697 |
{ |
Lines 711-716
Link Here
|
711 |
redisplay_selection(&oldSelection, &mSecondary); |
724 |
redisplay_selection(&oldSelection, &mSecondary); |
712 |
} |
725 |
} |
713 |
|
726 |
|
|
|
727 |
#if 0 |
714 |
void Fl_Text_Buffer_mod::secondary_select_rectangular(int start, int end, |
728 |
void Fl_Text_Buffer_mod::secondary_select_rectangular(int start, int end, |
715 |
int rectStart, |
729 |
int rectStart, |
716 |
int rectEnd) |
730 |
int rectEnd) |
Lines 720-731
Link Here
|
720 |
mSecondary.set_rectangular(start, end, rectStart, rectEnd); |
734 |
mSecondary.set_rectangular(start, end, rectStart, rectEnd); |
721 |
redisplay_selection(&oldSelection, &mSecondary); |
735 |
redisplay_selection(&oldSelection, &mSecondary); |
722 |
} |
736 |
} |
|
|
737 |
#endif |
723 |
|
738 |
|
724 |
int Fl_Text_Buffer_mod::secondary_selection_position(int *start, int *end) |
739 |
int Fl_Text_Buffer_mod::secondary_selection_position(int *start, int *end) |
725 |
{ |
740 |
{ |
726 |
return mSecondary.position(start, end); |
741 |
return mSecondary.position(start, end); |
727 |
} |
742 |
} |
728 |
|
743 |
|
|
|
744 |
#if 0 |
729 |
int Fl_Text_Buffer_mod::secondary_selection_position(int *start, int *end, |
745 |
int Fl_Text_Buffer_mod::secondary_selection_position(int *start, int *end, |
730 |
int *isRect, |
746 |
int *isRect, |
731 |
int *rectStart, |
747 |
int *rectStart, |
Lines 733-738
Link Here
|
733 |
{ |
749 |
{ |
734 |
return mSecondary.position(start, end, isRect, rectStart, rectEnd); |
750 |
return mSecondary.position(start, end, isRect, rectStart, rectEnd); |
735 |
} |
751 |
} |
|
|
752 |
#endif |
736 |
|
753 |
|
737 |
char *Fl_Text_Buffer_mod::secondary_selection_text() |
754 |
char *Fl_Text_Buffer_mod::secondary_selection_text() |
738 |
{ |
755 |
{ |
Lines 765-770
Link Here
|
765 |
redisplay_selection(&oldSelection, &mHighlight); |
782 |
redisplay_selection(&oldSelection, &mHighlight); |
766 |
} |
783 |
} |
767 |
|
784 |
|
|
|
785 |
#if 0 |
768 |
void Fl_Text_Buffer_mod::highlight_rectangular(int start, int end, |
786 |
void Fl_Text_Buffer_mod::highlight_rectangular(int start, int end, |
769 |
int rectStart, int rectEnd) |
787 |
int rectStart, int rectEnd) |
770 |
{ |
788 |
{ |
Lines 773-790
Link Here
|
773 |
mHighlight.set_rectangular(start, end, rectStart, rectEnd); |
791 |
mHighlight.set_rectangular(start, end, rectStart, rectEnd); |
774 |
redisplay_selection(&oldSelection, &mHighlight); |
792 |
redisplay_selection(&oldSelection, &mHighlight); |
775 |
} |
793 |
} |
|
|
794 |
#endif |
776 |
|
795 |
|
777 |
int Fl_Text_Buffer_mod::highlight_position(int *start, int *end) |
796 |
int Fl_Text_Buffer_mod::highlight_position(int *start, int *end) |
778 |
{ |
797 |
{ |
779 |
return mHighlight.position(start, end); |
798 |
return mHighlight.position(start, end); |
780 |
} |
799 |
} |
781 |
|
800 |
|
|
|
801 |
#if 0 |
782 |
int Fl_Text_Buffer_mod::highlight_position(int *start, int *end, |
802 |
int Fl_Text_Buffer_mod::highlight_position(int *start, int *end, |
783 |
int *isRect, int *rectStart, |
803 |
int *isRect, int *rectStart, |
784 |
int *rectEnd) |
804 |
int *rectEnd) |
785 |
{ |
805 |
{ |
786 |
return mHighlight.position(start, end, isRect, rectStart, rectEnd); |
806 |
return mHighlight.position(start, end, isRect, rectStart, rectEnd); |
787 |
} |
807 |
} |
|
|
808 |
#endif |
788 |
|
809 |
|
789 |
char *Fl_Text_Buffer_mod::highlight_text() |
810 |
char *Fl_Text_Buffer_mod::highlight_text() |
790 |
{ |
811 |
{ |
Lines 1403-1408
Link Here
|
1403 |
free((void *) outStr); |
1424 |
free((void *) outStr); |
1404 |
} |
1425 |
} |
1405 |
|
1426 |
|
|
|
1427 |
#if 0 |
1406 |
void Fl_Text_Buffer_mod::remove_rectangular_(int start, int end, int rectStart, |
1428 |
void Fl_Text_Buffer_mod::remove_rectangular_(int start, int end, int rectStart, |
1407 |
int rectEnd, int *replaceLen, |
1429 |
int rectEnd, int *replaceLen, |
1408 |
int *endPos) |
1430 |
int *endPos) |
Lines 1449-1455
Link Here
|
1449 |
*endPos = start + (outPtr - outStr) - len + endOffset; |
1471 |
*endPos = start + (outPtr - outStr) - len + endOffset; |
1450 |
free((void *) outStr); |
1472 |
free((void *) outStr); |
1451 |
} |
1473 |
} |
|
|
1474 |
#endif |
1452 |
|
1475 |
|
|
|
1476 |
#if 0 |
1453 |
void Fl_Text_Buffer_mod::overlay_rectangular_(int startPos, int rectStart, |
1477 |
void Fl_Text_Buffer_mod::overlay_rectangular_(int startPos, int rectStart, |
1454 |
int rectEnd, const char *insText, |
1478 |
int rectEnd, const char *insText, |
1455 |
int *nDeleted, int *nInserted, |
1479 |
int *nDeleted, int *nInserted, |
Lines 1511-1516
Link Here
|
1511 |
*endPos = start + (outPtr - outStr) - len + endOffset; |
1535 |
*endPos = start + (outPtr - outStr) - len + endOffset; |
1512 |
free((void *) outStr); |
1536 |
free((void *) outStr); |
1513 |
} |
1537 |
} |
|
|
1538 |
#endif |
1514 |
|
1539 |
|
1515 |
/* |
1540 |
/* |
1516 |
Inserts characters from single-line string \p insLine in single-line string |
1541 |
Inserts characters from single-line string \p insLine in single-line string |
Lines 1765-1776
Link Here
|
1765 |
*outLen = (outPtr - outStr) + strlen(linePtr); |
1790 |
*outLen = (outPtr - outStr) + strlen(linePtr); |
1766 |
} |
1791 |
} |
1767 |
|
1792 |
|
1768 |
|
|
|
1769 |
char *Fl_Text_Buffer_mod::selection_text_(Fl_Text_Selection * sel) const { |
1793 |
char *Fl_Text_Buffer_mod::selection_text_(Fl_Text_Selection * sel) const { |
1770 |
int start, end, isRect, rectStart, rectEnd; |
1794 |
int start, end; |
1771 |
|
1795 |
|
1772 |
/* If there's no selection, return an allocated empty string */ |
1796 |
/* If there's no selection, return an allocated empty string */ |
1773 |
if (!sel->position(&start, &end, &isRect, &rectStart, &rectEnd)) |
1797 |
if (!sel->position(&start, &end)) |
1774 |
{ |
1798 |
{ |
1775 |
char *s = (char *) malloc(1); |
1799 |
char *s = (char *) malloc(1); |
1776 |
*s = '\0'; |
1800 |
*s = '\0'; |
Lines 1778-1801
Link Here
|
1778 |
} |
1802 |
} |
1779 |
|
1803 |
|
1780 |
/* If the selection is not rectangular, return the selected range */ |
1804 |
/* If the selection is not rectangular, return the selected range */ |
1781 |
if (isRect) |
1805 |
return text_range(start, end); |
1782 |
return text_in_rectangle(start, end, rectStart, rectEnd); |
|
|
1783 |
else |
1784 |
return text_range(start, end); |
1785 |
} |
1806 |
} |
1786 |
|
1807 |
|
1787 |
void Fl_Text_Buffer_mod::remove_selection_(Fl_Text_Selection * sel) |
1808 |
void Fl_Text_Buffer_mod::remove_selection_(Fl_Text_Selection * sel) |
1788 |
{ |
1809 |
{ |
1789 |
int start, end, isRect, rectStart, rectEnd; |
1810 |
int start, end; |
1790 |
|
1811 |
|
1791 |
if (!sel->position(&start, &end, &isRect, &rectStart, &rectEnd)) |
1812 |
if (!sel->position(&start, &end)) |
1792 |
return; |
1813 |
return; |
1793 |
if (isRect) |
1814 |
|
1794 |
remove_rectangular(start, end, rectStart, rectEnd); |
1815 |
remove(start, end); |
1795 |
else { |
1816 |
//undoyankcut = undocut; |
1796 |
remove(start, end); |
|
|
1797 |
//undoyankcut = undocut; |
1798 |
} |
1799 |
} |
1817 |
} |
1800 |
|
1818 |
|
1801 |
|
1819 |
|
Lines 1805-1818
Link Here
|
1805 |
Fl_Text_Selection oldSelection = *sel; |
1823 |
Fl_Text_Selection oldSelection = *sel; |
1806 |
|
1824 |
|
1807 |
/* If there's no selection, return */ |
1825 |
/* If there's no selection, return */ |
1808 |
int start, end, isRect, rectStart, rectEnd; |
1826 |
int start, end; |
1809 |
if (!sel->position(&start, &end, &isRect, &rectStart, &rectEnd)) |
1827 |
if (!sel->position(&start, &end)) |
1810 |
return; |
1828 |
return; |
1811 |
|
1829 |
|
1812 |
/* Do the appropriate type of replace */ |
1830 |
/* Do the appropriate type of replace */ |
1813 |
if (isRect) |
|
|
1814 |
replace_rectangular(start, end, rectStart, rectEnd, text); |
1815 |
else |
1816 |
replace(start, end, text); |
1831 |
replace(start, end, text); |
1817 |
|
1832 |
|
1818 |
/* Unselect (happens automatically in BufReplace, but BufReplaceRect |
1833 |
/* Unselect (happens automatically in BufReplace, but BufReplaceRect |