git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15184 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-11-29 14:41:08 +00:00
parent dc309289c4
commit 45c5f0dfcb
2 changed files with 48 additions and 12 deletions

View file

@ -1,3 +1,7 @@
2002-11-29 Richard Frith-Macdonald <rfm@gnu.org>
* Model/IMConnectors.m: Update ivar setting code.
2002-11-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSBundleAdditions.m: Quick hack for setting ivars.

View file

@ -25,21 +25,13 @@
#include <string.h>
#include <gnustep/base/GSObjCRuntime.h>
#include <Foundation/NSObjCRuntime.h>
#include <AppKit/NSActionCell.h>
#include <AppKit/GMArchiver.h>
#include "AppKit/IMCustomObject.h"
#include "IMConnectors.h"
#ifndef GNUSTEP_BASE_LIBRARY
/* Define here so we can compile on OPENSTEP and MacOSX.
although this function will never be used there */
BOOL
GSSetInstanceVariable(id obj, NSString *iVarName, const void *data)
{
}
#endif
@implementation IMConnector
- (void)encodeWithModelArchiver:(GMArchiver*)archiver
@ -79,7 +71,20 @@ GSSetInstanceVariable(id obj, NSString *iVarName, const void *data)
}
else
{
GSSetInstanceVariable (_source, @"target", &_destination);
const char *type;
unsigned int size;
unsigned int offset;
/*
* Use the GNUstep additional function to set the instance
* variable directly.
* FIXME - need some way to do this for libFoundation and
* Foundation based systems.
*/
if (GSObjCFindVariable(_source, "target", &type, &size, &offset))
{
GSObjCSetVariable(_source, offset, size, (void*)&_destination);
}
}
if ([_source respondsToSelector:@selector(setAction:)])
@ -90,7 +95,20 @@ GSSetInstanceVariable(id obj, NSString *iVarName, const void *data)
}
else
{
GSSetInstanceVariable (_source, @"action", &action);
const char *type;
unsigned int size;
unsigned int offset;
/*
* Use the GNUstep additional function to set the instance
* variable directly.
* FIXME - need some way to do this for libFoundation and
* Foundation based systems.
*/
if (GSObjCFindVariable(_source, "action", &type, &size, &offset))
{
GSObjCSetVariable(_source, offset, size, (void*)&action);
}
}
}
@ -132,7 +150,21 @@ GSSetInstanceVariable(id obj, NSString *iVarName, const void *data)
}
else
{
GSSetInstanceVariable(_source, label, &_destination);
const char *nam = [label cString];
const char *type;
unsigned int size;
unsigned int offset;
/*
* Use the GNUstep additional function to set the instance
* variable directly.
* FIXME - need some way to do this for libFoundation and
* Foundation based systems.
*/
if (GSObjCFindVariable(_source, nam, &type, &size, &offset))
{
GSObjCSetVariable(_source, offset, size, (void*)&_destination);
}
}
}