Deploying to gh-pages from @ cappuccino/cappuccino@f01d83204e 🚀

This commit is contained in:
enquora committed 2026-10-24 15:47:42 +00:00
1 parent 4705d83973
commit 20a3f2b947
4 files changed
+362 -154

No files matched your search

+101 -2
View File
@@ -74748,7 +74748,7 @@ var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_
,["void"])]);
}
p;12;CPTextView.jt;254159;@STATIC;1.0;i;8;CPText.ji;14;CPPasteboard.ji;14;CPColorPanel.ji;15;CPFontManager.ji;15;CPTextStorage.ji;17;CPLayoutManager.ji;18;CPParagraphStyle.ji;17;CPTextContainer.ji;13;CPRulerView.ji;14;_CPRTFParser.ji;16;_CPRTFProducer.jt;253923;objj_executeFile("CPText.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPTextStorage.j", YES);objj_executeFile("CPLayoutManager.j", YES);objj_executeFile("CPParagraphStyle.j", YES);objj_executeFile("CPTextContainer.j", YES);objj_executeFile("CPRulerView.j", YES);objj_executeFile("_CPRTFParser.j", YES);objj_executeFile("_CPRTFProducer.j", YES);;
p;12;CPTextView.jt;262335;@STATIC;1.0;i;8;CPText.ji;14;CPPasteboard.ji;14;CPColorPanel.ji;15;CPFontManager.ji;15;CPTextStorage.ji;17;CPLayoutManager.ji;18;CPParagraphStyle.ji;17;CPTextContainer.ji;13;CPRulerView.ji;14;_CPRTFParser.ji;16;_CPRTFProducer.jt;262099;objj_executeFile("CPText.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPTextStorage.j", YES);objj_executeFile("CPLayoutManager.j", YES);objj_executeFile("CPParagraphStyle.j", YES);objj_executeFile("CPTextContainer.j", YES);objj_executeFile("CPRulerView.j", YES);objj_executeFile("_CPRTFParser.j", YES);objj_executeFile("_CPRTFProducer.j", YES);;
;
;
;
@@ -75396,6 +75396,8 @@ class_addMethods(the_class, [new objj_method(sel_getUid("allowsUndo"), function
return ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["undoManager"] || _objj_forward)(___r2, "undoManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["canUndo"] || _objj_forward)(___r1, "canUndo"));
if (action === sel_getUid("redo:"))
return ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["undoManager"] || _objj_forward)(___r2, "undoManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["canRedo"] || _objj_forward)(___r1, "canRedo"));
if (action === sel_getUid("superscript:") || action === sel_getUid("subscript:") || action === sel_getUid("unscript:") || action === sel_getUid("raiseBaseline:") || action === sel_getUid("lowerBaseline:"))
return (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && (self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText");
if (action === sel_getUid("copyRuler:"))
return (self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText");
if (action === sel_getUid("pasteRuler:"))
@@ -76502,7 +76504,104 @@ class_addMethods(the_class, [new objj_method(sel_getUid("allowsUndo"), function
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("alignLeft:"), function $CPTextView__alignLeft_(self, _cmd, sender)
,["void","id"]), new objj_method(sel_getUid("superscript:"), function $CPTextView__superscript_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPSuperscriptAttributeName, 1);
}
,["void","id"]), new objj_method(sel_getUid("subscript:"), function $CPTextView__subscript_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPSuperscriptAttributeName, -1);
}
,["void","id"]), new objj_method(sel_getUid("unscript:"), function $CPTextView__unscript_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_removeCharacterAttributes:"] || _objj_forward)(self, "_removeCharacterAttributes:", [CPSuperscriptAttributeName, CPBaselineOffsetAttributeName]);
}
,["void","id"]), new objj_method(sel_getUid("raiseBaseline:"), function $CPTextView__raiseBaseline_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPBaselineOffsetAttributeName, 1.0);
}
,["void","id"]), new objj_method(sel_getUid("lowerBaseline:"), function $CPTextView__lowerBaseline_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPBaselineOffsetAttributeName, -1.0);
}
,["void","id"]), new objj_method(sel_getUid("_changeCharacterAttribute:byAmount:"), function $CPTextView___changeCharacterAttribute_byAmount_(self, _cmd, anAttributeName, anAmount)
{
var range = CPMakeRangeCopy(self._selectionRange);
if (!range.length)
{
var newValue = (((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", anAttributeName)) || 0) + anAmount;
if (newValue)
((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", newValue, anAttributeName));
else
((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", anAttributeName));
((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextViewDidChangeTypingAttributesNotification, self));
return;
}
if (!(self.isa.method_msgSend["_beginCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_beginCharacterAttributeChangeInRange:", range))
return;
var location = range.location,
end = CPMaxRange(range);
while (location < end)
{
var effectiveRange = CPMakeRange(0, 0),
value = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attribute:atIndex:effectiveRange:"] || _objj_forward)(___r1, "attribute:atIndex:effectiveRange:", anAttributeName, location, effectiveRange)) || 0,
runRange = CPIntersectionRange(effectiveRange, range),
newValue = value + anAmount;
if (!runRange.length)
runRange = CPMakeRange(location, end - location);
if (newValue)
((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(___r1, "addAttribute:value:range:", anAttributeName, newValue, runRange));
else
((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAttribute:range:"] || _objj_forward)(___r1, "removeAttribute:range:", anAttributeName, runRange));
location = CPMaxRange(runRange);
}
(self.isa.method_msgSend["_endCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_endCharacterAttributeChangeInRange:", range);
var ___r1;
}
,["void","CPString","float"]), new objj_method(sel_getUid("_removeCharacterAttributes:"), function $CPTextView___removeCharacterAttributes_(self, _cmd, attributeNames)
{
var range = CPMakeRangeCopy(self._selectionRange);
if (!range.length)
{
for (var i = 0; i < attributeNames.length; i++)
((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", attributeNames[i]));
((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextViewDidChangeTypingAttributesNotification, self));
return;
}
if (!(self.isa.method_msgSend["_beginCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_beginCharacterAttributeChangeInRange:", range))
return;
for (var i = 0; i < attributeNames.length; i++)
((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAttribute:range:"] || _objj_forward)(___r1, "removeAttribute:range:", attributeNames[i], CPMakeRangeCopy(range)));
(self.isa.method_msgSend["_endCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_endCharacterAttributeChangeInRange:", range);
var ___r1;
}
,["void","CPArray"]), new objj_method(sel_getUid("_beginCharacterAttributeChangeInRange:"), function $CPTextView___beginCharacterAttributeChangeInRange_(self, _cmd, aRange)
{
if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || !(self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText") || !(self.isa.method_msgSend["shouldChangeTextInRange:replacementString:"] || _objj_forward)(self, "shouldChangeTextInRange:replacementString:", aRange, nil))
return NO;
((___r1 = ((___r2 = (self.isa.method_msgSend["_registeringUndoManager"] || _objj_forward)(self, "_registeringUndoManager")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(___r2, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_replaceCharactersInRange:withAttributedString:selectionRange:"] || _objj_forward)(___r1, "_replaceCharactersInRange:withAttributedString:selectionRange:", CPMakeRangeCopy(aRange), ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r2, "attributedSubstringFromRange:", CPMakeRangeCopy(aRange))), CPMakeRangeCopy(self._selectionRange)));
return YES;
var ___r1, ___r2;
}
,["BOOL","CPRange"]), new objj_method(sel_getUid("_endCharacterAttributeChangeInRange:"), function $CPTextView___endCharacterAttributeChangeInRange_(self, _cmd, aRange)
{
((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage:edited:range:changeInLength:invalidatedRange:"] || _objj_forward)(___r1, "textStorage:edited:range:changeInLength:invalidatedRange:", self._textStorage, 0, CPMakeRangeCopy(aRange), 0, CPMakeRangeCopy(aRange)));
((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs"));
(self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit");
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
(self.isa.method_msgSend["didChangeText"] || _objj_forward)(self, "didChangeText");
var ___r1;
}
,["void","CPRange"]), new objj_method(sel_getUid("alignLeft:"), function $CPTextView__alignLeft_(self, _cmd, sender)
{
(self.isa.method_msgSend["_setAlignment:"] || _objj_forward)(self, "_setAlignment:", CPLeftTextAlignment);
}
@@ -74748,7 +74748,7 @@ var meta_class = the_class.isa;class_addMethods(the_class, [new objj_method(sel_
,["void"])]);
}
p;12;CPTextView.jt;254159;@STATIC;1.0;i;8;CPText.ji;14;CPPasteboard.ji;14;CPColorPanel.ji;15;CPFontManager.ji;15;CPTextStorage.ji;17;CPLayoutManager.ji;18;CPParagraphStyle.ji;17;CPTextContainer.ji;13;CPRulerView.ji;14;_CPRTFParser.ji;16;_CPRTFProducer.jt;253923;objj_executeFile("CPText.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPTextStorage.j", YES);objj_executeFile("CPLayoutManager.j", YES);objj_executeFile("CPParagraphStyle.j", YES);objj_executeFile("CPTextContainer.j", YES);objj_executeFile("CPRulerView.j", YES);objj_executeFile("_CPRTFParser.j", YES);objj_executeFile("_CPRTFProducer.j", YES);;
p;12;CPTextView.jt;262335;@STATIC;1.0;i;8;CPText.ji;14;CPPasteboard.ji;14;CPColorPanel.ji;15;CPFontManager.ji;15;CPTextStorage.ji;17;CPLayoutManager.ji;18;CPParagraphStyle.ji;17;CPTextContainer.ji;13;CPRulerView.ji;14;_CPRTFParser.ji;16;_CPRTFProducer.jt;262099;objj_executeFile("CPText.j", YES);objj_executeFile("CPPasteboard.j", YES);objj_executeFile("CPColorPanel.j", YES);objj_executeFile("CPFontManager.j", YES);objj_executeFile("CPTextStorage.j", YES);objj_executeFile("CPLayoutManager.j", YES);objj_executeFile("CPParagraphStyle.j", YES);objj_executeFile("CPTextContainer.j", YES);objj_executeFile("CPRulerView.j", YES);objj_executeFile("_CPRTFParser.j", YES);objj_executeFile("_CPRTFProducer.j", YES);;
;
;
;
@@ -75396,6 +75396,8 @@ class_addMethods(the_class, [new objj_method(sel_getUid("allowsUndo"), function
return ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["undoManager"] || _objj_forward)(___r2, "undoManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["canUndo"] || _objj_forward)(___r1, "canUndo"));
if (action === sel_getUid("redo:"))
return ((___r1 = ((___r2 = (self.isa.method_msgSend["window"] || _objj_forward)(self, "window")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["undoManager"] || _objj_forward)(___r2, "undoManager"))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["canRedo"] || _objj_forward)(___r1, "canRedo"));
if (action === sel_getUid("superscript:") || action === sel_getUid("subscript:") || action === sel_getUid("unscript:") || action === sel_getUid("raiseBaseline:") || action === sel_getUid("lowerBaseline:"))
return (self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") && (self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText");
if (action === sel_getUid("copyRuler:"))
return (self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText");
if (action === sel_getUid("pasteRuler:"))
@@ -76502,7 +76504,104 @@ class_addMethods(the_class, [new objj_method(sel_getUid("allowsUndo"), function
var ___r1;
}
,["void","id"]), new objj_method(sel_getUid("alignLeft:"), function $CPTextView__alignLeft_(self, _cmd, sender)
,["void","id"]), new objj_method(sel_getUid("superscript:"), function $CPTextView__superscript_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPSuperscriptAttributeName, 1);
}
,["void","id"]), new objj_method(sel_getUid("subscript:"), function $CPTextView__subscript_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPSuperscriptAttributeName, -1);
}
,["void","id"]), new objj_method(sel_getUid("unscript:"), function $CPTextView__unscript_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_removeCharacterAttributes:"] || _objj_forward)(self, "_removeCharacterAttributes:", [CPSuperscriptAttributeName, CPBaselineOffsetAttributeName]);
}
,["void","id"]), new objj_method(sel_getUid("raiseBaseline:"), function $CPTextView__raiseBaseline_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPBaselineOffsetAttributeName, 1.0);
}
,["void","id"]), new objj_method(sel_getUid("lowerBaseline:"), function $CPTextView__lowerBaseline_(self, _cmd, aSender)
{
(self.isa.method_msgSend["_changeCharacterAttribute:byAmount:"] || _objj_forward)(self, "_changeCharacterAttribute:byAmount:", CPBaselineOffsetAttributeName, -1.0);
}
,["void","id"]), new objj_method(sel_getUid("_changeCharacterAttribute:byAmount:"), function $CPTextView___changeCharacterAttribute_byAmount_(self, _cmd, anAttributeName, anAmount)
{
var range = CPMakeRangeCopy(self._selectionRange);
if (!range.length)
{
var newValue = (((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["objectForKey:"] || _objj_forward)(___r1, "objectForKey:", anAttributeName)) || 0) + anAmount;
if (newValue)
((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["setObject:forKey:"] || _objj_forward)(___r1, "setObject:forKey:", newValue, anAttributeName));
else
((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", anAttributeName));
((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextViewDidChangeTypingAttributesNotification, self));
return;
}
if (!(self.isa.method_msgSend["_beginCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_beginCharacterAttributeChangeInRange:", range))
return;
var location = range.location,
end = CPMaxRange(range);
while (location < end)
{
var effectiveRange = CPMakeRange(0, 0),
value = ((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["attribute:atIndex:effectiveRange:"] || _objj_forward)(___r1, "attribute:atIndex:effectiveRange:", anAttributeName, location, effectiveRange)) || 0,
runRange = CPIntersectionRange(effectiveRange, range),
newValue = value + anAmount;
if (!runRange.length)
runRange = CPMakeRange(location, end - location);
if (newValue)
((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["addAttribute:value:range:"] || _objj_forward)(___r1, "addAttribute:value:range:", anAttributeName, newValue, runRange));
else
((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAttribute:range:"] || _objj_forward)(___r1, "removeAttribute:range:", anAttributeName, runRange));
location = CPMaxRange(runRange);
}
(self.isa.method_msgSend["_endCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_endCharacterAttributeChangeInRange:", range);
var ___r1;
}
,["void","CPString","float"]), new objj_method(sel_getUid("_removeCharacterAttributes:"), function $CPTextView___removeCharacterAttributes_(self, _cmd, attributeNames)
{
var range = CPMakeRangeCopy(self._selectionRange);
if (!range.length)
{
for (var i = 0; i < attributeNames.length; i++)
((___r1 = self._typingAttributes), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeObjectForKey:"] || _objj_forward)(___r1, "removeObjectForKey:", attributeNames[i]));
((___r1 = (CPNotificationCenter.isa.method_msgSend["defaultCenter"] || _objj_forward)(CPNotificationCenter, "defaultCenter")), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["postNotificationName:object:"] || _objj_forward)(___r1, "postNotificationName:object:", CPTextViewDidChangeTypingAttributesNotification, self));
return;
}
if (!(self.isa.method_msgSend["_beginCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_beginCharacterAttributeChangeInRange:", range))
return;
for (var i = 0; i < attributeNames.length; i++)
((___r1 = self._textStorage), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["removeAttribute:range:"] || _objj_forward)(___r1, "removeAttribute:range:", attributeNames[i], CPMakeRangeCopy(range)));
(self.isa.method_msgSend["_endCharacterAttributeChangeInRange:"] || _objj_forward)(self, "_endCharacterAttributeChangeInRange:", range);
var ___r1;
}
,["void","CPArray"]), new objj_method(sel_getUid("_beginCharacterAttributeChangeInRange:"), function $CPTextView___beginCharacterAttributeChangeInRange_(self, _cmd, aRange)
{
if (!(self.isa.method_msgSend["isEditable"] || _objj_forward)(self, "isEditable") || !(self.isa.method_msgSend["isRichText"] || _objj_forward)(self, "isRichText") || !(self.isa.method_msgSend["shouldChangeTextInRange:replacementString:"] || _objj_forward)(self, "shouldChangeTextInRange:replacementString:", aRange, nil))
return NO;
((___r1 = ((___r2 = (self.isa.method_msgSend["_registeringUndoManager"] || _objj_forward)(self, "_registeringUndoManager")), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["prepareWithInvocationTarget:"] || _objj_forward)(___r2, "prepareWithInvocationTarget:", self))), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_replaceCharactersInRange:withAttributedString:selectionRange:"] || _objj_forward)(___r1, "_replaceCharactersInRange:withAttributedString:selectionRange:", CPMakeRangeCopy(aRange), ((___r2 = self._textStorage), ___r2 == null ? ___r2 : (___r2.isa.method_msgSend["attributedSubstringFromRange:"] || _objj_forward)(___r2, "attributedSubstringFromRange:", CPMakeRangeCopy(aRange))), CPMakeRangeCopy(self._selectionRange)));
return YES;
var ___r1, ___r2;
}
,["BOOL","CPRange"]), new objj_method(sel_getUid("_endCharacterAttributeChangeInRange:"), function $CPTextView___endCharacterAttributeChangeInRange_(self, _cmd, aRange)
{
((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["textStorage:edited:range:changeInLength:invalidatedRange:"] || _objj_forward)(___r1, "textStorage:edited:range:changeInLength:invalidatedRange:", self._textStorage, 0, CPMakeRangeCopy(aRange), 0, CPMakeRangeCopy(aRange)));
((___r1 = self._layoutManager), ___r1 == null ? ___r1 : (___r1.isa.method_msgSend["_validateLayoutAndGlyphs"] || _objj_forward)(___r1, "_validateLayoutAndGlyphs"));
(self.isa.method_msgSend["sizeToFit"] || _objj_forward)(self, "sizeToFit");
(self.isa.method_msgSend["setNeedsDisplay:"] || _objj_forward)(self, "setNeedsDisplay:", YES);
(self.isa.method_msgSend["didChangeText"] || _objj_forward)(self, "didChangeText");
var ___r1;
}
,["void","CPRange"]), new objj_method(sel_getUid("alignLeft:"), function $CPTextView__alignLeft_(self, _cmd, sender)
{
(self.isa.method_msgSend["_setAlignment:"] || _objj_forward)(self, "_setAlignment:", CPLeftTextAlignment);
}
+10
View File
@@ -26,7 +26,12 @@ TextEditor is a document-based test application and a tutorial. When the app use
### Text view
How the text system works, for the entries below: `CPTextView` does not use CSS text layout. `CPSimpleTypesetter` measures text with the canvas `measureText` (`sizeWithFont:inWidth:` in `CPStringDrawing.j`), measuring growing substrings so that each character's advancement includes the browser's kerning. It then breaks lines, places tabs, and applies indents and alignment itself (`CPTypesetter.j`). `_CPLineFragment` (`CPLayoutManager.j`) draws each run of identical attributes as one absolutely positioned `<span>`, at the computed position, with `white-space: pre` and the run's font, colour and underline in CSS. Inside a span the browser shapes the glyphs, including its own kerning and ligatures.
- **Format > Font > Copy Style and Paste Style raise an exception.** They send `copyFont:` and `pasteFont:`, which `CPText` declares as abstract methods that raise (`CPText.j:210` and `:261`). `CPTextView` does not implement them, so the menu items are enabled and choosing one raises. `CPTextView` needs Cocoa's implementations: copy the font and character attributes at the selection to the font pasteboard (`CPFontPboard`), and apply them to the selection.
- **Format > Text > Justify crashes the application.** `alignJustified:` sets the paragraph style's alignment to `CPJustifiedTextAlignment`, but the typesetter's alignment handling has cases only for left, centred and right text (`_flushRange:` in `CPTypesetter.j`). The exception text from the browser console will show where the crash occurs. Justified layout needs a full implementation: spreading each line's spare width across its spaces, except on the last line of a paragraph.
- **Kerning and ligature settings are not implemented.** Format > Font > Kern sends `useStandardKerning:`, `turnOffKerning:`, `tightenKerning:` and `loosenKerning:`, and Format > Font > Ligatures sends `useStandardLigatures:`, `turnOffLigatures:` and `useAllLigatures:`. `CPTextView` implements none of them, so the items are disabled. `CPText.j` defines `CPKernAttributeName` and `CPLigatureAttributeName`, but only the RTF producer reads them. A complete implementation needs: the seven actions, changing the attributes over the selection or the typing attributes with undo, as the baseline actions do; the typesetter adding a run's `CPKernAttributeName` value to each character's advancement, and measuring with the same ligature setting it draws with; and `_CPLineFragment` setting CSS `letter-spacing` and `font-variant-ligatures` on each run's span to match.
- **The font panel needs polish.** Found during the Format menu review on 24 October: the panel works with the text view, but its appearance and behaviour need refinement. The specific problems are not yet recorded; list them here, compared with the native font panel, when the panel is reviewed. `CPFontPanel` is in `AppKit/CPTextView/CPFontPanel.j`.
### Ruler
@@ -45,6 +50,10 @@ TextEditor is a document-based test application and a tutorial. When the app use
- **Key equivalents on platforms other than macOS.** Filed as an issue.
## Opportunities for improvement
- **Line breaking is greedy.** `CPSimpleTypesetter` fills each line as far as it fits, as Cocoa does. Typesetting quality, especially in justified text, needs paragraph-wide line breaking in the manner of Knuth-Plass, as Typst also uses, with language-aware hyphenation. Cappuccino measures and lays out text itself, so this belongs in the typesetter, as its only behaviour, with no setting for users or developers. It follows justification.
## Planned additions to the app
- Fonts through `CPFontManager` and `CPFontPanel`.
@@ -73,4 +82,5 @@ TextEditor is a document-based test application and a tutorial. When the app use
- Text stays inside the visible width, with Cocoa's 5-point line fragment padding.
- Tab characters: the Tab key inserts a tab in the text view, and left, centre, right and decimal tab stops align their columns.
- Format > Text > Copy Ruler and Paste Ruler apply one paragraph's indents and tab stops to others.
- Format > Font > Baseline: superscript, subscript, raised and lowered baselines lay out correctly, and Use Default restores the text, for an exact or a wider selection.
- Builds with both the legacy toolchain and capp-build.
+150 -150
View File
@@ -1,150 +1,150 @@
1792814079976|ArrayControllerInitialSelectionTest|
1792814079995|ArrayControllerRemovingFirstTest|
1792814080139|ArrayControllerTest|
1792814080324|AttachedSheet2Test|
1792814080511|AttachedSheetTest|
1792814080698|BindingContentArrayTest|
1792814080883|CGCanvasContextTest|
1792814080106|CGPathTest|
1792814080125|CPAlertTest|
1792814080144|CPAnimatablePropertyContainerTest|
1792814080162|CPAnimationContextTest|
1792814080181|CPAnimationTest|
1792814080200|CPBinderEchoBug|
1792814080218|CPBoxCibTest|
1792814080237|CPBoxTest|
1792814080255|CPBrowserTest|
1792814080274|CPButtonBarTest|
1792814080292|CPButtonKeyEquivalentDefaultTest|
1792814080310|CPButtonTest|
1792814080329|CPByteCountFormatterTest|
1792814080347|CPCollectionViewNibTest|
1792814080366|CPColorCPImageDescriptionTest|
1792814080384|CPColorWellBindingsTest|
1792814080403|CPComboBoxTest|
1792814080421|CPControlPerformClickExceptionTest|
1792814080440|CPControlSizeTest|
1792814080458|CPCursorTest|
1792814080477|CPDateFormatterTest|
1792814080495|CPDatePickerTest|
1792814080514|CPDictionaryControllerTest|
1792814080532|CPDocumentControllerTest|
1792814080550|CPFormatterTest|
1792814080569|CPGraphicsTest|
1792814080588|CPImageAndTextViewImageScalingTest|
1792814080606|CPImageViewAlignmentScaling|
1792814080624|CPImageViewTest|
1792814080643|CPImageViewbindingsTest|
1792814080661|CPLanguageModelChatbotTest|
1792814080680|CPLevelIndicator|
1792814080698|CPLevelIndicatorTest|
1792814080717|CPLocalizationTest|
1792814080736|CPLogTest|
1792814080754|CPMarkdownParserTest|
1792814080773|CPMenuCALayerTest|
1792814080791|CPMenuEnabledBindingsTest|
1792814080810|CPMenuKeyEquivalentsTest|
1792814080828|CPMenuRemoveAllTest|
1792814080847|CPMenuSubmenuPlacementConstraints|
1792814080865|CPMenuTest|
1792814080884|CPOutlineViewCibTest|
1792814080902|CPOutlineViewTest|
1792814080920|CPOutlineViewViewBasedCibTest|
1792814080939|CPPanelTest|
1792814080957|CPPlatformWindow|
1792814080975|CPPlattformWindowMinSize|
1792814080994|CPPopUpButtonBindingsTest|
1792814081121|CPPopUpButtonTest|
1792814081303|CPPopoverTest|
1792814081486|CPPredicateEditorCibTest|
1792814081668|CPProgressIndicatorTest|
1792814081853|CPPropertyListSerializationTest|
1792814081103|CPRadioBindingsTest|
1792814081121|CPRuleEditorCibTest|
1792814081140|CPRuleEditorTest|
1792814081158|CPScrollView2Test|
1792814081176|CPScrollViewTest|
1792814081194|CPSearchFieldPredicateBinding|
1792814081213|CPSearchFieldTest|
1792814081231|CPSegmentedControlBindingsTest|
1792814081249|CPSegmentedControlTest|
1792814081267|CPSoundTest|
1792814081285|CPSplitViewDividerTest|
1792814081304|CPSplitViewTest|
1792814081322|CPStackViewTest|
1792814081340|CPStepperBindingsTest|
1792814081358|CPStepperNibTest|
1792814081376|CPTabView2Test|
1792814081395|CPTabViewBindingsTest|
1792814081413|CPTabViewNibTest|
1792814081431|CPTableViewGroupRowsTest|
1792814081450|CPTextFieldEditingStyleTest|
1792814081468|CPTextFieldHeightTest|
1792814081486|CPTextFieldMovementsTest|
1792814081504|CPTextFieldMultiLineTest|
1792814081523|CPTextFieldTest|
1792814081541|CPTextViewCibTest|
1792814081559|CPTextViewDelegateAndNotificationsTest|
1792814081577|CPTimeZoneTest|
1792814081595|CPTokenFieldTest|
1792814081614|CPToolTipTest|
1792814081632|CPToolbarTest|
1792814081650|CPTreeControllerTest|
1792814081668|CPURLConnectionAsyncTest|
1792814081687|CPURLConnectionSynchronousTest|
1792814081705|CPUserDefaultsControllerTest|
1792814081723|CPUserDefaultsTest|
1792814081741|CPUserNotificationTest|
1792814081760|CPViewControllerTest|
1792814081778|CPVisualEffectViewTest|
1792814081796|CPWebViewTest|
1792814081815|CPWebViewTest2|
1792814081833|CPWindowLiveResizeTest|
1792814081851|CPWindowMovableTest|
1792814081869|CPWindowResizeStyleTest|
1792814081888|ChildWindowsTest|
1792814081907|CompilationTests|
1792814081927|ContinuouslyUpdatesValueBinding|
1792814081945|CopyAndPasteTest|
1792814081964|CrossOriginTest|
1792814081982|FF4096Test|
1792814082106|FontEnhancementTest|
1792814082194|FontMetricsExplorerTest|
1792814082378|KeyEquivalentsTest|
1792814082563|KeyViewLoopTest|
1792814082749|KeyWindowInTheBackgroundActivation|
1792814082934|LayoutTest|
1792814082111|LoadDynamicFrameworksTest|
1792814082130|LoadTimeTest|
1792814082148|LongBindingsTest|
1792814082166|MobileTest|
1792814082185|MultipleValueBindingsTest|
1792814082203|NSBoxTest|
1792814082222|NSBrowserTest|
1792814082240|NewTextFieldBezelTest|
1792814082258|Nib2CibAlignmentTest|
1792814082277|Nib2CibBaselineAlignementTest|
1792814082295|Nib2CibSubviewsOrderTest|
1792814082314|NibAppRemixedTest|
1792814082332|PatternFillTest|
1792814082351|PlatformWindowsTest|
1792814082370|PopUpButtonEscTest|
1792814082388|PredicateWithFormatTest|
1792814082406|ResignFirstResponderWithCPControlTextDidEndEditingTest|
1792814082425|Scaling2Test|
1792814082443|ScalingTest|
1792814082461|ScrollviewThemingTest|
1792814082480|SimpleBindings2Test|
1792814082498|SizeToFitTest|
1792814082517|SmartFoldersDemo|
1792814082535|SmartFoldersTest|
1792814082553|TableTest|
1792814082572|TextEditor|
1792814082590|ThemeBrowserTest|
1792814082609|ThemeKitchenSinkTest|
1792814082627|TrackingAreaTest|
1792814082646|UndoRedoWithMenuUpdateTest|
1792814082664|UserlandNSTest|
1792814082682|WindowSheetOrderTest|
1792814082701|layoutEphemeralSubviewTest|
1792814082719|performKeyEquivalentTest|
1792856857104|ArrayControllerInitialSelectionTest|
1792856857122|ArrayControllerRemovingFirstTest|
1792856857140|ArrayControllerTest|
1792856857159|AttachedSheet2Test|
1792856857177|AttachedSheetTest|
1792856857196|BindingContentArrayTest|
1792856857214|CGCanvasContextTest|
1792856857233|CGPathTest|
1792856857251|CPAlertTest|
1792856857269|CPAnimatablePropertyContainerTest|
1792856857289|CPAnimationContextTest|
1792856857308|CPAnimationTest|
1792856857327|CPBinderEchoBug|
1792856857346|CPBoxCibTest|
1792856857365|CPBoxTest|
1792856857384|CPBrowserTest|
1792856857405|CPButtonBarTest|
1792856857424|CPButtonKeyEquivalentDefaultTest|
1792856857444|CPButtonTest|
1792856857463|CPByteCountFormatterTest|
1792856857481|CPCollectionViewNibTest|
1792856857500|CPColorCPImageDescriptionTest|
1792856857519|CPColorWellBindingsTest|
1792856857537|CPComboBoxTest|
1792856857555|CPControlPerformClickExceptionTest|
1792856857574|CPControlSizeTest|
1792856857592|CPCursorTest|
1792856857611|CPDateFormatterTest|
1792856857629|CPDatePickerTest|
1792856857648|CPDictionaryControllerTest|
1792856857666|CPDocumentControllerTest|
1792856857685|CPFormatterTest|
1792856857704|CPGraphicsTest|
1792856857723|CPImageAndTextViewImageScalingTest|
1792856857742|CPImageViewAlignmentScaling|
1792856857761|CPImageViewTest|
1792856857780|CPImageViewbindingsTest|
1792856857798|CPLanguageModelChatbotTest|
1792856857816|CPLevelIndicator|
1792856857834|CPLevelIndicatorTest|
1792856857852|CPLocalizationTest|
1792856857870|CPLogTest|
1792856857888|CPMarkdownParserTest|
1792856857906|CPMenuCALayerTest|
1792856857924|CPMenuEnabledBindingsTest|
1792856857942|CPMenuKeyEquivalentsTest|
1792856857960|CPMenuRemoveAllTest|
1792856857979|CPMenuSubmenuPlacementConstraints|
1792856857997|CPMenuTest|
1792856858155|CPOutlineViewCibTest|
1792856858337|CPOutlineViewTest|
1792856858519|CPOutlineViewViewBasedCibTest|
1792856858704|CPPanelTest|
1792856858886|CPPlatformWindow|
1792856858106|CPPlattformWindowMinSize|
1792856858124|CPPopUpButtonBindingsTest|
1792856858141|CPPopUpButtonTest|
1792856858159|CPPopoverTest|
1792856858177|CPPredicateEditorCibTest|
1792856858194|CPProgressIndicatorTest|
1792856858213|CPPropertyListSerializationTest|
1792856858231|CPRadioBindingsTest|
1792856858250|CPRuleEditorCibTest|
1792856858268|CPRuleEditorTest|
1792856858286|CPScrollView2Test|
1792856858305|CPScrollViewTest|
1792856858324|CPSearchFieldPredicateBinding|
1792856858343|CPSearchFieldTest|
1792856858361|CPSegmentedControlBindingsTest|
1792856858378|CPSegmentedControlTest|
1792856858396|CPSoundTest|
1792856858414|CPSplitViewDividerTest|
1792856858432|CPSplitViewTest|
1792856858449|CPStackViewTest|
1792856858467|CPStepperBindingsTest|
1792856858485|CPStepperNibTest|
1792856858502|CPTabView2Test|
1792856858520|CPTabViewBindingsTest|
1792856858537|CPTabViewNibTest|
1792856858555|CPTableViewGroupRowsTest|
1792856858573|CPTextFieldEditingStyleTest|
1792856858592|CPTextFieldHeightTest|
1792856858609|CPTextFieldMovementsTest|
1792856858627|CPTextFieldMultiLineTest|
1792856858645|CPTextFieldTest|
1792856858662|CPTextViewCibTest|
1792856858680|CPTextViewDelegateAndNotificationsTest|
1792856858698|CPTimeZoneTest|
1792856858716|CPTokenFieldTest|
1792856858734|CPToolTipTest|
1792856858753|CPToolbarTest|
1792856858771|CPTreeControllerTest|
1792856858790|CPURLConnectionAsyncTest|
1792856858809|CPURLConnectionSynchronousTest|
1792856858827|CPUserDefaultsControllerTest|
1792856858845|CPUserDefaultsTest|
1792856858862|CPUserNotificationTest|
1792856858880|CPViewControllerTest|
1792856858897|CPVisualEffectViewTest|
1792856858915|CPWebViewTest|
1792856858933|CPWebViewTest2|
1792856858952|CPWindowLiveResizeTest|
1792856858972|CPWindowMovableTest|
1792856858990|CPWindowResizeStyleTest|
1792856859936|ChildWindowsTest|
1792856859281|CompilationTests|
1792856859471|ContinuouslyUpdatesValueBinding|
1792856859660|CopyAndPasteTest|
1792856859844|CrossOriginTest|
1792856859103|FF4096Test|
1792856859121|FontEnhancementTest|
1792856859139|FontMetricsExplorerTest|
1792856859157|KeyEquivalentsTest|
1792856859175|KeyViewLoopTest|
1792856859193|KeyWindowInTheBackgroundActivation|
1792856859211|LayoutTest|
1792856859228|LoadDynamicFrameworksTest|
1792856859246|LoadTimeTest|
1792856859264|LongBindingsTest|
1792856859281|MobileTest|
1792856859299|MultipleValueBindingsTest|
1792856859317|NSBoxTest|
1792856859336|NSBrowserTest|
1792856859355|NewTextFieldBezelTest|
1792856859373|Nib2CibAlignmentTest|
1792856859392|Nib2CibBaselineAlignementTest|
1792856859410|Nib2CibSubviewsOrderTest|
1792856859427|NibAppRemixedTest|
1792856859445|PatternFillTest|
1792856859463|PlatformWindowsTest|
1792856859481|PopUpButtonEscTest|
1792856859498|PredicateWithFormatTest|
1792856859516|ResignFirstResponderWithCPControlTextDidEndEditingTest|
1792856859533|Scaling2Test|
1792856859552|ScalingTest|
1792856859570|ScrollviewThemingTest|
1792856859588|SimpleBindings2Test|
1792856859607|SizeToFitTest|
1792856859624|SmartFoldersDemo|
1792856859642|SmartFoldersTest|
1792856859659|TableTest|
1792856859677|TextEditor|
1792856859694|ThemeBrowserTest|
1792856859712|ThemeKitchenSinkTest|
1792856859729|TrackingAreaTest|
1792856859747|UndoRedoWithMenuUpdateTest|
1792856859765|UserlandNSTest|
1792856859784|WindowSheetOrderTest|
1792856859802|layoutEphemeralSubviewTest|
1792856859820|performKeyEquivalentTest|