Deploying to gh-pages from @ cappuccino/cappuccino@894a60ad45 🚀

This commit is contained in:
daboe01
2026-06-16 17:29:41 +00:00
parent 1756c4e3c9
commit 1015ce3f87
4 changed files with 2966 additions and 376 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+102 -6
View File
@@ -2,7 +2,7 @@
* AppController.j
*
* Manual test application for the cappuccino text system
* Copyright (C) 2014 Daniel Boehringer
* Copyright (C) 2026 Daniel Boehringer
*/
@import <Foundation/Foundation.j>
@@ -14,6 +14,8 @@
@import <AppKit/CPTextField.j>
@import <AppKit/CPScrollView.j>
@import <AppKit/CPParagraphStyle.j>
@import <AppKit/CPTextStorage.j>
@import <AppKit/_CPTableTextAttachment.j>
@implementation AppController : CPObject
{
@@ -90,6 +92,25 @@
[_textView insertText:@" "];
}
- (void)insertTable:(id)sender
{
var headers = [@"Item Description", @"Quantity", @"Unit Price"];
var rows = [
[@"Cappuccino Web Framework Lic.", @"2", @"$199.00"],
[@"Objective-J Development Support", @"5", @"$150.00"],
[@"Cloud Compilation VM Server", @"1", @"$49.00"]
];
var tableAttachment = [[_CPTableTextAttachment alloc] initWithHeaders:headers rows:rows width:500.0];
// Insert single-character atomic text attachment
var tableAttrStr = [CPTextStorage attributedStringWithAttachment:tableAttachment];
[_textView insertText:@"\ntable (own line)\n"];
[_textView insertText:tableAttrStr];
[_textView insertText:@"\nend table"];
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
@@ -133,10 +154,18 @@
var rtfButton = [[CPButton alloc] initWithFrame:CGRectMake(currentX, 15, 150, 30)];
[rtfButton setTitle:@"RTF Round-trip ➔"];
[rtfButton setTarget:self];
[rtfButton setAction:@selector(makeRTF:)];
[rtfButton setAction:@selector(rtfRoundTrip:)];
[toolbarView addSubview:rtfButton];
currentX += 160;
// NEW: Markdown Converter Trigger
var mdButton = [[CPButton alloc] initWithFrame:CGRectMake(currentX, 15, 120, 30)];
[mdButton setTitle:@"← Markdown"];
[mdButton setTarget:self];
[mdButton setAction:@selector(convertMarkdownToRichText:)];
[toolbarView addSubview:mdButton];
currentX += 130;
// Insert Attachment Trigger
var attachButton = [[CPButton alloc] initWithFrame:CGRectMake(currentX, 15, 140, 30)];
[attachButton setTitle:@"Insert Attachment"];
@@ -145,6 +174,14 @@
[toolbarView addSubview:attachButton];
currentX += 150;
// Add Table Trigger
var tableButton = [[CPButton alloc] initWithFrame:CGRectMake(currentX, 15, 100, 30)];
[tableButton setTitle:@"Add Table"];
[tableButton setTarget:self];
[tableButton setAction:@selector(insertTable:)];
[toolbarView addSubview:tableButton];
currentX += 110;
// Text Alignment Group
var labelAlign = [[CPTextField alloc] initWithFrame:CGRectMake(currentX, 22, 45, 20)];
[labelAlign setStringValue:@"Align:"];
@@ -210,9 +247,10 @@
[leftLabel setAutoresizingMask:CPViewWidthSizable];
[leftContainer addSubview:leftLabel];
_textView = [[CPTextView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([leftContainer bounds]) - 30, CGRectGetHeight([leftContainer bounds]) - 70)];
_textView = [[CPTextView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([leftContainer bounds]) - 30, 0)];
[_textView setRichText:YES];
[_textView setBackgroundColor:[CPColor whiteColor]];
[[_textView textContainer] setWidthTracksTextView:YES];
_scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(15, 40, CGRectGetWidth([leftContainer bounds]) - 30, CGRectGetHeight([leftContainer bounds]) - 65)];
[_scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
@@ -225,7 +263,7 @@
// Right Container: RTF Plain-Text Source and Parser Window
var rightLabel = [[CPTextField alloc] initWithFrame:CGRectMake(15, 10, CGRectGetWidth([rightContainer bounds]) - 30, 20)];
[rightLabel setStringValue:@"RTF Raw Output & Source Parser Window"];
[rightLabel setStringValue:@"Markdown Source & RTF Source Code Window"];
[rightLabel setFont:[CPFont boldSystemFontOfSize:14]];
[rightLabel setAutoresizingMask:CPViewWidthSizable];
[rightContainer addSubview:rightLabel];
@@ -257,8 +295,6 @@
[editMenu addItemWithTitle:@"Redo" action:@selector(redo:) keyEquivalent:@"Z"];
[mainMenu setSubmenu:editMenu forItem:item];
item = [mainMenu insertItemWithTitle:@"Format" action:nil keyEquivalent:nil atIndex:0];
// Format Menu
item = [mainMenu insertItemWithTitle:@"Format" action:nil keyEquivalent:nil atIndex:0];
var formatMenu = [[CPMenu alloc] initWithTitle:@"Format Menu"];
@@ -321,6 +357,21 @@
[_textView insertText:[[CPAttributedString alloc] initWithString:@"This paragraph has a first-line indent of 30pt, a head indent of 50pt, and a tail indent of -30pt. Check the horizontal ruler above to see how the indent markers align with this paragraph, and adjust them directly!\n"
attributes:[CPDictionary dictionaryWithObject:indentParagraph forKey:CPParagraphStyleAttributeName]]];
[_textView insertText:@"\n"];
// 5. Pre-populate Markdown editor with rich table sample content
[_textView2 setString:@"# Markdown Parser Output\n\n" +
"You can type markdown directly in this side panel and click **← Markdown** above to convert it!\n\n" +
"## Inline styling showcase\n\n" +
"• Combine ***bold and italic*** styles.\n" +
"• Monospaced `code elements` represent code blocks.\n\n" +
"## Data Table\n\n" +
"| Item Description | Quantity | Unit Price |\n" +
"| :--- | :---: | :---: |\n" +
"| Cappuccino Web Framework Lic. | 2 | $199.00 |\n" +
"| Objective-J Development Support | 5 | $150.00 |\n" +
"| Cloud Compilation VM Server | 1 | $49.00 |"];
[theWindow orderFront:self];
[CPMenu setMenuBarVisible:YES];
}
@@ -334,4 +385,49 @@
[_textView insertText: mystr];
}
// Action tied to the "RTF Round-trip ->" button in the demo app
- (void)rtfRoundTrip:(id)sender
{
// 1. Retrieve the rich text storage from the editor on the left
var textStorage = [_textView textStorage];
if (!textStorage || [textStorage length] == 0)
{
return;
}
// 2. Serialize the CPAttributedString into an RTF string
var docAttributes = @{ @"PaperSize": CPMakeSize(612, 792) };
var generatedRTF = [_CPRTFProducer produceRTF:textStorage documentAttributes:docAttributes];
// 3. Set the generated RTF string into the raw output pane on the right
[_textView2 setString:generatedRTF];
// 4. Parse that exact RTF text back into a new CPAttributedString
var parser = [[_CPRTFParser alloc] init];
var roundTrippedString = [parser parseRTF:generatedRTF];
// Safe fallback sequence
[_textView setEditable:YES];
[_textView setString:@""];
[_textView insertText:roundTrippedString];
}
// Action tied to the "Markdown ->" button to generate rich text
- (void)convertMarkdownToRichText:(id)sender
{
// 1. Retrieve markdown string from the right pane
var markdownInput = [_textView2 string];
if (!markdownInput || [markdownInput length] == 0)
{
return;
}
// 2. Parse the markdown using the updated MarkdownParser class
var parsedAttrStr = [CPMarkdownParser attributedStringFromMarkdown:markdownInput];
[_textView setEditable:YES];
[_textView setString:@""];
[_textView insertText:parsedAttrStr];
}
@end
+146 -146
View File
@@ -1,146 +1,146 @@
1781383704109|ArrayController1|
1781383704123|ArrayControllerInitialSelectionTest|
1781383704137|ArrayControllerRemovingFirstTest|
1781383704150|AttachedSheet|
1781383704164|AttachedSheet2|
1781383704177|Bindings|
1781383704191|CGCanvasContext|
1781383704204|CGPath|
1781383704217|CPAlertTest|
1781383704231|CPAnimatablePropertyContainerTest|
1781383704244|CPAnimationContextTest|
1781383704258|CPAnimationTest|
1781383704271|CPBinder-echo-bug|
1781383704285|CPBoxCibTest|
1781383704298|CPBoxTest|
1781383704312|CPBrowserTest|
1781383704325|CPButtonBarTest|
1781383704339|CPButtonKeyEquivalentDefaultTest|
1781383704352|CPButtonTest|
1781383704366|CPByteCountFormatter|
1781383704379|CPCollectionViewNibTest|
1781383704393|CPColor-CPImage-description|
1781383704406|CPColorWellBindings|
1781383704419|CPComboBoxTest|
1781383704433|CPControlPerformClickExceptionTest|
1781383704447|CPControlSize|
1781383704460|CPCursor|
1781383704474|CPDateFormatterTest|
1781383704487|CPDatePickerTest|
1781383704501|CPDictionaryControllerTest|
1781383704514|CPDocumentControllerTest|
1781383704528|CPFormatterTest|
1781383704541|CPGraphicsTest|
1781383704555|CPImageAndTextViewImageScaling|
1781383704568|CPImageViewAlignmentScaling|
1781383704582|CPImageViewTest|
1781383704595|CPImageViewbindingsTest|
1781383704609|CPLevelIndicator|
1781383704623|CPLocalizationTest|
1781383704636|CPLogTest|
1781383704649|CPMenuCALayerTest|
1781383704663|CPMenuEnabledBindingsTest|
1781383704676|CPMenuKeyEquivalents|
1781383704690|CPMenuRemoveAllTest|
1781383704703|CPMenuSubmenuPlacementConstraints|
1781383704717|CPMenuTest|
1781383704731|CPOutlineViewCibTest|
1781383704744|CPOutlineViewTest|
1781383704758|CPOutlineViewViewBasedCibTest|
1781383704771|CPPanelTest|
1781383704785|CPPlatformWindow|
1781383704798|CPPlattformWindowMinSize|
1781383704812|CPPopUpButtonBindings|
1781383704825|CPPopUpButtonTest|
1781383704839|CPPopover|
1781383704852|CPPredicateEditorCibTest|
1781383704866|CPProgressIndicator|
1781383704879|CPPropertyListSerializationTest|
1781383704892|CPRadioBindings|
1781383704906|CPRuleEditorCibTest|
1781383704919|CPRuleEditorTestI8N|
1781383704933|CPScrollView|
1781383704947|CPScrollView2|
1781383704960|CPSearchField|
1781383704973|CPSearchFieldPredicateBinding|
1781383704987|CPSegmentedControlBindings|
1781383705000|CPSegmentedControlTest|
1781383705014|CPSoundTest|
1781383705027|CPSplitViewDivider|
1781383705041|CPSplitViewTest|
1781383705054|CPStackViewTest|
1781383705068|CPStepperBindings|
1781383705081|CPStepperNibTest|
1781383705094|CPTabView2|
1781383705108|CPTabViewBindings|
1781383705121|CPTabViewNib|
1781383705135|CPTableViewGroupRows|
1781383705148|CPTextField|
1781383705162|CPTextFieldEditingStyleTest|
1781383705175|CPTextFieldHeightTest|
1781383705189|CPTextFieldMovementsTest|
1781383705202|CPTextFieldMultiline|
1781383705215|CPTextView|
1781383705229|CPTextViewCibTest|
1781383705242|CPTextViewDelegateAndNotifications|
1781383705255|CPTimeZone|
1781383705269|CPTokenFieldTest|
1781383705282|CPToolTip|
1781383705296|CPToolbarTest|
1781383705309|CPTreeControllerTest|
1781383705323|CPURLConnectionAsyncTest|
1781383705336|CPURLConnectionSynchronousTest|
1781383705349|CPUserDefaults|
1781383705363|CPUserDefaultsControllerTest|
1781383705377|CPUserNotificationTest|
1781383705390|CPViewController|
1781383705404|CPVisualEffectViewTest|
1781383705417|CPWebViewTest|
1781383705431|CPWebViewTest2|
1781383705444|CPWindowLiveResizeTest|
1781383705457|CPWindowMovableTest|
1781383705471|CPWindowResizeStyle|
1781383705484|ChildWindows|
1781383705498|CompilationTests|
1781383705511|ContinuouslyUpdatesValueBinding|
1781383705525|CopyAndPaste|
1781383705538|CrossOriginTest|
1781383705552|FF4096Test|
1781383705565|FontEnhancementTest|
1781383705578|FontMetricsExplorer|
1781383705592|KeyEquivalents|
1781383705605|KeyViewLoopTest|
1781383705619|KeyWindowInTheBackgroundActivation|
1781383705632|LayoutTest|
1781383705646|LoadTimeTest|
1781383705660|LongBindings|
1781383705673|MobileTest|
1781383705687|MultipleValueBindings|
1781383705701|NSBoxTest|
1781383705714|NSBrowserTest|
1781383705728|NewTextFieldBezel|
1781383705741|Nib2CibAlignment|
1781383705755|Nib2CibBaselineAlignementTest|
1781383705769|Nib2CibSubviewsOrderTest|
1781383705782|NibAppRemixed|
1781383705796|PatternFillTest|
1781383705809|PlatformWindows|
1781383705822|PopUpButtonEscTest|
1781383705836|ScalingTest|
1781383705849|ScalingTest2|
1781383705863|ScrollviewTheming|
1781383705876|SheetWindowOrderFrontIssue|
1781383705890|SimpleBindings2|
1781383705903|SmartFoldersDemo|
1781383705917|TableTest|
1781383705930|ThemeBrowser|
1781383705944|ThemeKitchenSink|
1781383705957|TrackingArea|
1781383705971|UndoRedoWithMenuUpdate|
1781383705984|UserlandNSTest|
1781383705998|layoutEphemeralSubviewTest|
1781383706011|loadDynamicFrameworks|
1781383706025|performKeyEquivalentTest|
1781383706039|predicateWithFormat|
1781383706052|resignFirstResponder-CPControlTextDidEndEditing|
1781383706066|sizeToFitFix|
1781630976304|ArrayController1|
1781630976318|ArrayControllerInitialSelectionTest|
1781630976331|ArrayControllerRemovingFirstTest|
1781630976345|AttachedSheet|
1781630976358|AttachedSheet2|
1781630976371|Bindings|
1781630976385|CGCanvasContext|
1781630976398|CGPath|
1781630976412|CPAlertTest|
1781630976425|CPAnimatablePropertyContainerTest|
1781630976439|CPAnimationContextTest|
1781630976452|CPAnimationTest|
1781630976466|CPBinder-echo-bug|
1781630976479|CPBoxCibTest|
1781630976493|CPBoxTest|
1781630976506|CPBrowserTest|
1781630976520|CPButtonBarTest|
1781630976533|CPButtonKeyEquivalentDefaultTest|
1781630976547|CPButtonTest|
1781630976560|CPByteCountFormatter|
1781630976574|CPCollectionViewNibTest|
1781630976587|CPColor-CPImage-description|
1781630976600|CPColorWellBindings|
1781630976614|CPComboBoxTest|
1781630976627|CPControlPerformClickExceptionTest|
1781630976640|CPControlSize|
1781630976654|CPCursor|
1781630976667|CPDateFormatterTest|
1781630976680|CPDatePickerTest|
1781630976694|CPDictionaryControllerTest|
1781630976707|CPDocumentControllerTest|
1781630976720|CPFormatterTest|
1781630976733|CPGraphicsTest|
1781630976747|CPImageAndTextViewImageScaling|
1781630976760|CPImageViewAlignmentScaling|
1781630976773|CPImageViewTest|
1781630976787|CPImageViewbindingsTest|
1781630976800|CPLevelIndicator|
1781630976813|CPLocalizationTest|
1781630976827|CPLogTest|
1781630976840|CPMenuCALayerTest|
1781630976853|CPMenuEnabledBindingsTest|
1781630976867|CPMenuKeyEquivalents|
1781630976880|CPMenuRemoveAllTest|
1781630976893|CPMenuSubmenuPlacementConstraints|
1781630976907|CPMenuTest|
1781630976920|CPOutlineViewCibTest|
1781630976933|CPOutlineViewTest|
1781630976947|CPOutlineViewViewBasedCibTest|
1781630976960|CPPanelTest|
1781630976973|CPPlatformWindow|
1781630976987|CPPlattformWindowMinSize|
1781630977000|CPPopUpButtonBindings|
1781630977013|CPPopUpButtonTest|
1781630977026|CPPopover|
1781630977040|CPPredicateEditorCibTest|
1781630977053|CPProgressIndicator|
1781630977067|CPPropertyListSerializationTest|
1781630977080|CPRadioBindings|
1781630977093|CPRuleEditorCibTest|
1781630977107|CPRuleEditorTestI8N|
1781630977120|CPScrollView|
1781630977134|CPScrollView2|
1781630977148|CPSearchField|
1781630977161|CPSearchFieldPredicateBinding|
1781630977175|CPSegmentedControlBindings|
1781630977188|CPSegmentedControlTest|
1781630977202|CPSoundTest|
1781630977215|CPSplitViewDivider|
1781630977228|CPSplitViewTest|
1781630977241|CPStackViewTest|
1781630977255|CPStepperBindings|
1781630977268|CPStepperNibTest|
1781630977281|CPTabView2|
1781630977295|CPTabViewBindings|
1781630977308|CPTabViewNib|
1781630977321|CPTableViewGroupRows|
1781630977335|CPTextField|
1781630977348|CPTextFieldEditingStyleTest|
1781630977362|CPTextFieldHeightTest|
1781630977375|CPTextFieldMovementsTest|
1781630977388|CPTextFieldMultiline|
1781630977402|CPTextView|
1781630977415|CPTextViewCibTest|
1781630977428|CPTextViewDelegateAndNotifications|
1781630977442|CPTimeZone|
1781630977455|CPTokenFieldTest|
1781630977468|CPToolTip|
1781630977482|CPToolbarTest|
1781630977495|CPTreeControllerTest|
1781630977508|CPURLConnectionAsyncTest|
1781630977522|CPURLConnectionSynchronousTest|
1781630977535|CPUserDefaults|
1781630977548|CPUserDefaultsControllerTest|
1781630977562|CPUserNotificationTest|
1781630977575|CPViewController|
1781630977589|CPVisualEffectViewTest|
1781630977602|CPWebViewTest|
1781630977615|CPWebViewTest2|
1781630977628|CPWindowLiveResizeTest|
1781630977642|CPWindowMovableTest|
1781630977655|CPWindowResizeStyle|
1781630977669|ChildWindows|
1781630977682|CompilationTests|
1781630977695|ContinuouslyUpdatesValueBinding|
1781630977709|CopyAndPaste|
1781630977723|CrossOriginTest|
1781630977737|FF4096Test|
1781630977751|FontEnhancementTest|
1781630977765|FontMetricsExplorer|
1781630977779|KeyEquivalents|
1781630977792|KeyViewLoopTest|
1781630977806|KeyWindowInTheBackgroundActivation|
1781630977820|LayoutTest|
1781630977834|LoadTimeTest|
1781630977848|LongBindings|
1781630977862|MobileTest|
1781630977876|MultipleValueBindings|
1781630977890|NSBoxTest|
1781630977903|NSBrowserTest|
1781630977916|NewTextFieldBezel|
1781630977930|Nib2CibAlignment|
1781630977943|Nib2CibBaselineAlignementTest|
1781630977957|Nib2CibSubviewsOrderTest|
1781630977970|NibAppRemixed|
1781630977983|PatternFillTest|
1781630977997|PlatformWindows|
1781630978010|PopUpButtonEscTest|
1781630978023|ScalingTest|
1781630978036|ScalingTest2|
1781630978050|ScrollviewTheming|
1781630978063|SheetWindowOrderFrontIssue|
1781630978076|SimpleBindings2|
1781630978090|SmartFoldersDemo|
1781630978104|TableTest|
1781630978118|ThemeBrowser|
1781630978132|ThemeKitchenSink|
1781630978146|TrackingArea|
1781630978160|UndoRedoWithMenuUpdate|
1781630978173|UserlandNSTest|
1781630978187|layoutEphemeralSubviewTest|
1781630978200|loadDynamicFrameworks|
1781630978213|performKeyEquivalentTest|
1781630978227|predicateWithFormat|
1781630978240|resignFirstResponder-CPControlTextDidEndEditing|
1781630978253|sizeToFitFix|