Author: matt
Date: 2010-11-06 16:16:07 -0700 (Sat, 06 Nov 2010)
New Revision: 7806
Log:
Removed some unused stuff and duplicates.
Modified:
branches/branch-1.3/FL/Fl_Text_Buffer.H
branches/branch-1.3/src/Fl_Text_Buffer.cxx
branches/branch-1.3/src/Fl_Text_Display.cxx
Modified: branches/branch-1.3/FL/Fl_Text_Buffer.H
===================================================================
--- branches/branch-1.3/FL/Fl_Text_Buffer.H 2010-11-06 17:51:00 UTC (rev
7805)
+++ branches/branch-1.3/FL/Fl_Text_Buffer.H 2010-11-06 23:16:07 UTC (rev
7806)
@@ -646,32 +646,6 @@
int findchar_backward(int startPos, unsigned searchChar, int* foundPos)
const;
/**
- Finds the next occurrence of the specified characters.
- Search forwards in buffer for characters in \p searchChars, starting
- with the character \p startPos, and returning the result in \p foundPos
- returns 1 if found, 0 if not.
- \param startPos byte offset to start position
- \param searchChars utf8 string that we want to find
- \param foundPos byte offset where the string was found
- \return 1 if found, 0 if not
- \todo unicode check
- */
- int findchars_forward(int startPos, const char* searchChars, int* foundPos)
const;
-
- /**
- Finds the previous occurrence of the specified characters.
- Search backwards in buffer for characters in \p searchChars, starting
- with the character BEFORE \p startPos, returning the result in \p foundPos
- returns 1 if found, 0 if not.
- \param startPos byte offset to start position
- \param searchChars utf8 string that we want to find
- \param foundPos byte offset where the string was found
- \return 1 if found, 0 if not
- \todo unicode check
- */
- int findchars_backward(int startPos, const char* searchChars, int* foundPos)
const;
-
- /**
Search forwards in buffer for string \p searchString, starting with the
character \p startPos, and returning the result in \p foundPos
returns 1 if found, 0 if not.
Modified: branches/branch-1.3/src/Fl_Text_Buffer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Text_Buffer.cxx 2010-11-06 17:51:00 UTC (rev
7805)
+++ branches/branch-1.3/src/Fl_Text_Buffer.cxx 2010-11-06 23:16:07 UTC (rev
7806)
@@ -859,14 +859,13 @@
Matt: I am not sure why we need this function. Does it still make sense in
the world of proportional characters?
*/
-// FIXME: this is misleading and mey be used to count bytes instead of
characters!
int Fl_Text_Buffer::count_displayed_characters(int lineStartPos,
int targetPos) const
{
+ // FIXME: this is misleading and may be used to count bytes instead of
characters!
IS_UTF8_ALIGNED(address(lineStartPos))
IS_UTF8_ALIGNED(address(targetPos))
- // TODO: is this function still needed? If it is, put this functionality in
handle_vline?
int charCount = 0;
int pos = lineStartPos;
@@ -882,11 +881,11 @@
Matt: I am not sure why we need this function. Does it still make sense in
the world of proportional characters?
*/
-// FIXME: this is misleading and mey be used to count bytes instead of
characters!
// All values are number of bytes.
// - unicode ok?
int Fl_Text_Buffer::skip_displayed_characters(int lineStartPos, int nChars)
{
+ // FIXME: this is misleading and may be used to count bytes instead of
characters!
IS_UTF8_ALIGNED(address(lineStartPos))
// FIXME: is this function still needed?
int pos = lineStartPos;
@@ -1093,81 +1092,8 @@
/*
- Find a matching string in the buffer.
- NOT TESTED FOR UNICODE.
- */
-int Fl_Text_Buffer::findchars_forward(int startPos, const char *searchChars,
- int *foundPos) const {
- // FIXME: unicode?
- int gapLen = mGapEnd - mGapStart;
- const char *c;
-
- int pos = startPos;
- while (pos < mGapStart)
- {
- for (c = searchChars; *c != '\0'; c++) {
- if (mBuf[pos] == *c) {
- *foundPos = pos;
- return 1;
- }
- } pos++;
- }
- while (pos < mLength) {
- for (c = searchChars; *c != '\0'; c++) {
- if (mBuf[pos + gapLen] == *c) {
- *foundPos = pos;
- return 1;
- }
- }
- pos++;
- }
- *foundPos = mLength;
- return 0;
-}
-
-
-/*
- Find a matching string in the buffer.
- NOT TESTED FOR UNICODE.
- */
-int Fl_Text_Buffer::findchars_backward(int startPos, const char *searchChars,
- int *foundPos) const {
- // FIXME: Unicode
- int gapLen = mGapEnd - mGapStart;
- const char *c;
-
- if (startPos == 0)
- {
- *foundPos = 0;
- return 0;
- }
- int pos = startPos == 0 ? 0 : startPos - 1;
- while (pos >= mGapStart) {
- for (c = searchChars; *c != '\0'; c++) {
- if (mBuf[pos + gapLen] == *c) {
- *foundPos = pos;
- return 1;
- }
- }
- pos--;
- }
- while (pos >= 0) {
- for (c = searchChars; *c != '\0'; c++) {
- if (mBuf[pos] == *c) {
- *foundPos = pos;
- return 1;
- }
- }
- pos--;
- }
- *foundPos = 0;
- return 0;
-}
-
-
-/*
Insert a string into the buffer.
- Unicode safe. Pos must be at a character boundary. Text must be a correct
utf8 string.
+ Pos must be at a character boundary. Text must be a correct utf8 string.
*/
int Fl_Text_Buffer::insert_(int pos, const char *text)
{
@@ -1519,13 +1445,12 @@
/*
Find a UCS-4 character.
- Unicode safe. StartPos must be at a charcter boundary, searchChar is UCS-4
encoded.
+ StartPos must be at a charcter boundary, searchChar is UCS-4 encoded.
*/
int Fl_Text_Buffer::findchar_forward(int startPos, unsigned searchChar,
int *foundPos) const
- {
- if (startPos >= mLength)
- {
+{
+ if (startPos >= mLength) {
*foundPos = mLength;
return 0;
}
@@ -1533,8 +1458,6 @@
if (startPos<0)
startPos = 0;
- // TODO: for performance reasons, we can re-insert the ASCII search here
which is about three times as fast if searchChar is <128
-
for ( ; startPos<mLength; startPos = next_char(startPos)) {
if (searchChar == char_at(startPos)) {
*foundPos = startPos;
@@ -1549,9 +1472,9 @@
/*
Find a UCS-4 character.
- Unicode safe. StartPos must be at a charcter boundary, searchChar is UCS-4
encoded.
+ StartPos must be at a charcter boundary, searchChar is UCS-4 encoded.
*/
-int Fl_Text_Buffer::findchar_backward(int startPos, unsigned searchChar,
+int Fl_Text_Buffer::findchar_backward(int startPos, unsigned int searchChar,
int *foundPos) const {
if (startPos <= 0) {
*foundPos = 0;
@@ -1561,8 +1484,6 @@
if (startPos > mLength)
startPos = mLength;
- // TODO: for performance reasons, we can re-insert the ASCII search here
which is about three times as fast if searchChar is <128
-
for (startPos = prev_char(startPos); startPos>=0; startPos =
prev_char(startPos)) {
if (searchChar == char_at(startPos)) {
*foundPos = startPos;
Modified: branches/branch-1.3/src/Fl_Text_Display.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Text_Display.cxx 2010-11-06 17:51:00 UTC (rev
7805)
+++ branches/branch-1.3/src/Fl_Text_Display.cxx 2010-11-06 23:16:07 UTC (rev
7806)
@@ -26,6 +26,13 @@
//
// TODO: check all functions for UTF-8/UCS-4 compatibility!
+// TODO: fix all fime's and todo's
+// TODO: blinking selection when moving mouse outside of widget area
+// TODO: line wrapping - scroll bars
+// TODO: verify all "pixel position" vs. "column" values
+// TODO: verify all "byte counts" vs. "character counts"
+// TODO: rendering of the Tab character
+// TODO: rendering of the "optional hyphen"
#include <stdio.h>
#include <stdlib.h>
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit