mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:20:38 +00:00
Correction for window size in -[NSWindowTemplate nibInstantiate]. Implemented encoding in encodeWithCoder: for some classes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23207 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1b1a55d80b
commit
78abe49764
12 changed files with 394 additions and 165 deletions
|
@ -1443,23 +1443,51 @@ typedef struct _GSButtonCellFlags
|
|||
{
|
||||
BOOL tmp;
|
||||
|
||||
// FIXME: Add new ivars
|
||||
[super encodeWithCoder: aCoder];
|
||||
if([aCoder allowsKeyedCoding])
|
||||
{
|
||||
GSButtonCellFlags buttonCellFlags;
|
||||
unsigned int bFlags = 0;
|
||||
unsigned int bFlags2 = 0;
|
||||
|
||||
[aCoder encodeObject: _keyEquivalent];
|
||||
[aCoder encodeObject: _keyEquivalentFont];
|
||||
[aCoder encodeObject: _altContents];
|
||||
[aCoder encodeObject: _altImage];
|
||||
tmp = _buttoncell_is_transparent;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL)
|
||||
at: &tmp];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int)
|
||||
at: &_keyEquivalentModifierMask];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int)
|
||||
at: &_highlightsByMask];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int)
|
||||
at: &_showAltStateMask];
|
||||
[aCoder encodeObject: [self keyEquivalent] forKey: @"NSKeyEquivalent"];
|
||||
[aCoder encodeObject: [self image] forKey: @"NSNormalImage"];
|
||||
[aCoder encodeObject: [self alternateTitle] forKey: @"NSAlternateContents"];
|
||||
|
||||
// encode button flags...
|
||||
buttonCellFlags.isTransparent = [self isTransparent];
|
||||
buttonCellFlags.isBordered = [self isBordered];
|
||||
buttonCellFlags.highlightByBackground = (_highlightsByMask & NSChangeBackgroundCellMask);
|
||||
buttonCellFlags.highlightByContents = (_highlightsByMask & NSContentsCellMask);
|
||||
buttonCellFlags.isPushin = (_highlightsByMask & NSPushInCellMask);
|
||||
buttonCellFlags.changeBackground = (_showAltStateMask & NSChangeBackgroundCellMask);
|
||||
buttonCellFlags.changeContents = (_showAltStateMask & NSContentsCellMask);
|
||||
memcpy((void *)&bFlags, (void *)&buttonCellFlags,sizeof(unsigned int));
|
||||
[aCoder encodeInt: bFlags forKey: @"NSButtonFlags"];
|
||||
|
||||
// style and border.
|
||||
bFlags2 != [self showsBorderOnlyWhileMouseInside] ? 0x8 : 0;
|
||||
bFlags2 |= [self bezelStyle];
|
||||
[aCoder encodeInt: bFlags2 forKey: @"NSButtonFlags2"];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Add new ivars
|
||||
[aCoder encodeObject: _keyEquivalent];
|
||||
[aCoder encodeObject: _keyEquivalentFont];
|
||||
[aCoder encodeObject: _altContents];
|
||||
[aCoder encodeObject: _altImage];
|
||||
tmp = _buttoncell_is_transparent;
|
||||
[aCoder encodeValueOfObjCType: @encode(BOOL)
|
||||
at: &tmp];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int)
|
||||
at: &_keyEquivalentModifierMask];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int)
|
||||
at: &_highlightsByMask];
|
||||
[aCoder encodeValueOfObjCType: @encode(unsigned int)
|
||||
at: &_showAltStateMask];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue