JX Application Framework
|
#include "JStyledText.h"
#include "JSTUndoTyping.h"
#include "JSTUndoPaste.h"
#include "JSTUndoMove.h"
#include "JSTUndoStyle.h"
#include "JSTUndoTabShift.h"
#include "JFontManager.h"
#include "JColorManager.h"
#include "JListUtil.h"
#include "JRunArrayIterator.h"
#include "JRegex.h"
#include "JStringIterator.h"
#include "JStringMatch.h"
#include "JInterpolate.h"
#include "JLatentPG.h"
#include "JMinMax.h"
#include "jTextUtil.h"
#include "jASCIIConstants.h"
#include "jFStreamUtil.h"
#include "jStreamUtil.h"
#include "jFileUtil.h"
#include "jGlobals.h"
#include "jAssert.h"
#include "JStyledTextSetFont.th"
Macros | |
#define | LocalVarName size |
#define | GetElementName GetSize() |
#define | SetElementName SetSize |
#define | LocalVarName bold |
#define | GetElementName GetStyle().bold |
#define | SetElementName SetBold |
#define | LocalVarName italic |
#define | GetElementName GetStyle().italic |
#define | SetElementName SetItalic |
#define | LocalVarName count |
#define | GetElementName GetStyle().underlineCount |
#define | SetElementName SetUnderlineCount |
#define | LocalVarName strike |
#define | GetElementName GetStyle().strike |
#define | SetElementName SetStrike |
#define | LocalVarName color |
#define | GetElementName GetStyle().color |
#define | SetElementName SetColor |
#define | LocalVarName style |
#define | GetElementName GetStyle() |
#define | SetElementName SetStyle |
#define | COPY_FOR_CLEAN_TEXT |
#define | CLEAN_WS_ALIGNMENT |
Typedefs | |
using | FontIterator = JRunArrayIterator< JFont > |
Functions | |
bool | isWhitespace (const JUtf8Character &c) |
void | jComputeForwardFontRange (const JStyledText::TextIndex &start, const JString &text, const FontIterator &iter, const bool wrapped, JStyledText::TextRange *range) |
void | jComputeBackwardFontRange (const JStyledText::TextIndex &start, const JString &text, const FontIterator &iter, const bool wrapped, JStyledText::TextRange *range) |
bool | jCRMIsEOS (const JUtf8Character &c) |
Variables | |
const JFileVersion | kCurrentPrivateFormatVersion = 1 |
const JSize | kDefaultMaxUndoCount = 100 |
const JSize | kUNIXLineWidth = 75 |
const JSize | kUNIXTabCharCount = 8 |
#define CLEAN_WS_ALIGNMENT |
Clean up the indentation whitespace and strip trailing whitespace in the specified range.
Returns the range of the resulting text.
#define COPY_FOR_CLEAN_TEXT |
Removes illegal characters, converts to UNIX newline format, adjusts fonts to ensure that all characters will be rendered correctly, lets derived class perform additional filtering. Returns true if the text was modified.
okToInsert is true if derived class filtering accepted the text.
#define GetElementName GetSize() |
#define GetElementName GetStyle().bold |
#define GetElementName GetStyle().italic |
#define GetElementName GetStyle().underlineCount |
#define GetElementName GetStyle().strike |
#define GetElementName GetStyle().color |
#define GetElementName GetStyle() |
#define LocalVarName size |
#define LocalVarName bold |
#define LocalVarName italic |
#define LocalVarName count |
#define LocalVarName strike |
#define LocalVarName color |
#define LocalVarName style |
#define SetElementName SetSize |
#define SetElementName SetBold |
#define SetElementName SetItalic |
#define SetElementName SetUnderlineCount |
#define SetElementName SetStrike |
#define SetElementName SetColor |
#define SetElementName SetStyle |
using FontIterator = JRunArrayIterator<JFont> |
|
inline |
void jComputeBackwardFontRange | ( | const JStyledText::TextIndex & | start, |
const JString & | text, | ||
const FontIterator & | iter, | ||
const bool | wrapped, | ||
JStyledText::TextRange * | range | ||
) |
Look for the match before the current position. If we find it, we select it and return true.
void jComputeForwardFontRange | ( | const JStyledText::TextIndex & | start, |
const JString & | text, | ||
const FontIterator & | iter, | ||
const bool | wrapped, | ||
JStyledText::TextRange * | range | ||
) |
Look for the next match beyond the given position.
|
inline |
Read one block of { spaces + word (non-spaces) } from itsBuffer, starting at *charIndex, stopping if we get as far as endCharIndex. *spaceBuffer contains the whitespace (spaces + tabs) that was found. *spaceCount is the equivalent number of spaces. *wordBuffer contains the word. charIndex is incremented to point to the next character to read.
Newlines are treated separately. If a newline is encountered while reading spaces, we throw out the spaces and return kFoundNewLine. If a newline is encountered while reading a word, we leave it for the next time, when we immediately return kFoundNewLine.
When we pass the position origCaretIndex, we set *totalCount to be the index into *spaceBuffer+*wordBuffer. Otherwise, we do not change totalCount.
const JFileVersion kCurrentPrivateFormatVersion = 1 |
const JSize kDefaultMaxUndoCount = 100 |
const JSize kUNIXLineWidth = 75 |
const JSize kUNIXTabCharCount = 8 |