-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSBox_Additions.m
40 lines (32 loc) · 1.17 KB
/
NSBox_Additions.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// NSBox Additions implementation
//
//
// Author: Gregory John Casamento
// Date: 2024
//
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import "NSBox_Additions.h"
#import "NSString_Additions.h"
#import "NIBParser.h"
#import "NSObject_KeyExtraction.h"
#import "NSView_Additions.h"
#import "XMLNode.h"
@implementation NSBox (toXML)
- (XMLNode *) toXMLWithParser: (id<OidProvider>)parser
{
NSString *className = NSStringFromClass([self class]);
NSString *tagName = [className classNameToTagName];
XMLNode *boxNode = [[XMLNode alloc] initWithName: tagName];
NSView *contentView = [self contentView];
XMLNode *contentViewNode = [contentView toXMLWithParser: parser];
XMLNode *contentNodeContainer = [[XMLNode alloc] initWithName: @"contentView"];
[boxNode addAttribute: @"id" value: [parser oidForObject: self]];
[boxNode addAttribute: @"title" value: [self title]];
// [boxNode addAttribute: @"borderType" value: [self borderType]];
// [boxNode addAttribute: @"boxType" value: [self boxType]];
[boxNode addElement: contentNodeContainer];
[contentNodeContainer addElement: contentViewNode];
return boxNode;
}
@end