Use more properties and prefix ivars with _ #8

Merged
Letterus merged 1 commits from js/objgtkgen:more-properties-and-prefix-ivars into main 8 months ago
  1. 3
      src/BaseClasses/OGTK.h
  2. 3
      src/BaseClasses/OGTKBaseBuilder.h
  3. 50
      src/BaseClasses/OGTKCallbackData.h
  4. 45
      src/BaseClasses/OGTKCallbackData.m
  5. 3
      src/BaseClasses/OGTKSignalConnector.h
  6. 21
      src/BaseClasses/OGTKSignalData.h
  7. 35
      src/BaseClasses/OGTKSignalData.m
  8. 8
      src/GIR/GIRApi.h
  9. 25
      src/GIR/GIRApi.m
  10. 12
      src/GIR/GIRArray.h
  11. 26
      src/GIR/GIRArray.m
  12. 4
      src/GIR/GIRBase.h
  13. 17
      src/GIR/GIRBase.m
  14. 28
      src/GIR/GIRClass.h
  15. 87
      src/GIR/GIRClass.m
  16. 18
      src/GIR/GIRConstant.h
  17. 41
      src/GIR/GIRConstant.m
  18. 28
      src/GIR/GIRConstructor.h
  19. 59
      src/GIR/GIRConstructor.m
  20. 6
      src/GIR/GIRDoc.h
  21. 17
      src/GIR/GIRDoc.m
  22. 18
      src/GIR/GIREnumeration.h
  23. 65
      src/GIR/GIREnumeration.m
  24. 12
      src/GIR/GIRField.h
  25. 23
      src/GIR/GIRField.m
  26. 26
      src/GIR/GIRFunction.h
  27. 57
      src/GIR/GIRFunction.m
  28. 2
      src/GIR/GIRImplements.h
  29. 7
      src/GIR/GIRImplements.m
  30. 57
      src/GIR/GIRInterface.m
  31. 8
      src/GIR/GIRMember.h
  32. 19
      src/GIR/GIRMember.m
  33. 30
      src/GIR/GIRMethod.h
  34. 65
      src/GIR/GIRMethod.m
  35. 16
      src/GIR/GIRNamespace.h
  36. 57
      src/GIR/GIRNamespace.m
  37. 24
      src/GIR/GIRParameter.h
  38. 45
      src/GIR/GIRParameter.m
  39. 2
      src/GIR/GIRPrerequisite.h
  40. 7
      src/GIR/GIRPrerequisite.m
  41. 28
      src/GIR/GIRProperty.h
  42. 55
      src/GIR/GIRProperty.m
  43. 8
      src/GIR/GIRReturnValue.h
  44. 21
      src/GIR/GIRReturnValue.m
  45. 4
      src/GIR/GIRType.h
  46. 13
      src/GIR/GIRType.m
  47. 3
      src/GIR/GIRVarargs.h
  48. 9
      src/GIR/GIRVarargs.m
  49. 3
      src/GIR/GIRVirtualMethod.h
  50. 9
      src/GIR/GIRVirtualMethod.m
  51. Some files were not shown because too many files have changed in this diff Show More

3
src/BaseClasses/OGTK.h

@ -35,8 +35,7 @@
/**
* Global level CoreGTK functionality
*/
@interface OGTK : OFObject {
}
@interface OGTK : OFObject
/**
* Returns the CoreGTK version string

3
src/BaseClasses/OGTKBaseBuilder.h

@ -34,8 +34,7 @@
/**
* OGTKBuilder adds additional functionality to GtkBuilder
*/
@interface OGTKBaseBuilder : OFObject {
}
@interface OGTKBaseBuilder : OFObject
/**
* When enabled this builder will print out signal connection debug info

50
src/BaseClasses/OGTKCallbackData.h

@ -32,63 +32,47 @@
*/
@interface OGTKCallbackData : OFObject {
id _object;
SEL _sel;
SEL _selector;
}
/**
* The held object.
*/
@property (retain, nonatomic) id object;
/**
* The held selector.
*/
@property (nonatomic) SEL selector;
/**
* Creates and returns a new instance of OGTKCallbackData holding the object and
* the selector.
*
* Note this returned instance is autoreleased.
*
* @param obj
* @param object
* The object to hold
*
* @param sel
* @param selelector
* The selector to hold
*
* @returns a new OGTKCallbackData
*/
+ (id)withObject:(id)obj andSEL:(SEL)sel;
+ (instancetype)callbackWithObject:(id)object selector:(SEL)selector;
/**
* Creates and returns a new instance of OGTKCallbackData holding the object and
* the selector.
*
* @param obj
* @param object
* The object to hold
*
* @param sel
* @param selector
* The selector to hold
*
* @returns a new OGTKCallbackData
*/
- (id)initWithObject:(id)obj andSEL:(SEL)sel;
/**
* Gets the held object
*/
- (id)object;
/**
* Gets the held selector
*/
- (SEL)sel;
/**
* Sets the held object
*
* @param object
* The object to set
*/
- (void)setObject:(id)object;
/**
* Sets the held selector
*
* @param sel
* The selector to set
*/
- (void)setSel:(SEL)sel;
- (instancetype)initWithObject:(id)object selector:(SEL)selector;
@end

45
src/BaseClasses/OGTKCallbackData.m

@ -28,52 +28,29 @@
#import "OGTKCallbackData.h"
@implementation OGTKCallbackData
@synthesize object = _object, selector = _selector;
- (id)initWithObject:(id)obj andSEL:(SEL)sel
+ (instancetype)callbackWithObject:(id)obj selector:(SEL)sel
{
return [[[OGTKCallbackData alloc] initWithObject:object
selector:selector] autorelease];
}
- (instancetype)initWithObject:(id)obj andSEL:(SEL)sel
{
self = [super init];
_object = obj;
_sel = sel;
[_object retain];
_object = [object retain];
_selector = selector;
return self;
}
+ (id)withObject:(id)obj andSEL:(SEL)sel
{
return [[[OGTKCallbackData alloc] initWithObject:obj
andSEL:sel] autorelease];
}
- (void)dealloc
{
[_object release];
[super dealloc];
}
- (id)object
{
return [[_object retain] autorelease];
}
- (SEL)sel
{
return _sel;
}
- (void)setObject:(id)object
{
if (_object != nil) {
[_object release];
}
_object = object;
}
- (void)setSel:(SEL)sel
{
_sel = sel;
[super dealloc];
}
@end

3
src/BaseClasses/OGTKSignalConnector.h

@ -34,8 +34,7 @@ void gsignal_forwarder(gpointer gtk, OGTKSignalData* data);
/**
* Provides functions for GCallback signal connecting
*/
@interface OGTKSignalConnector : OFObject {
}
@interface OGTKSignalConnector : OFObject
/**
* Connects a GCallback function to a signal for a particular object. The

21
src/BaseClasses/OGTKSignalData.h

@ -31,16 +31,19 @@
* Wraps GCallback signal data
*/
@interface OGTKSignalData : OFObject {
id target;
SEL selector;
void* data;
bool retained;
id _target;
SEL _selector;
void* _data;
bool _retained;
}
- (id)initWithTarget:(id)target selector:(SEL)selector data:(void*)data;
- (id)target;
- (SEL)selector;
- (void*)data;
- (bool)dataRetained;
@property (readonly, nonatomic) id target;
@property (readonly) SEL selector;
@property (readonly) void* data;
@property (readonly, getter=isDataRetained) bool dataRetained;
- (instancetype)initWithTarget:(id)target
selector:(SEL)selector
data:(void*)data;
@end

35
src/BaseClasses/OGTKSignalData.m

@ -28,35 +28,20 @@
#import "OGTKSignalData.h"
@implementation OGTKSignalData : OFObject
@synthesize target = _target, selector = _selector, data = _data;
@synthesize dataRetained = _retained;
- (id)initWithTarget:(id)_target selector:(SEL)_selector data:(void*)_data
- (instancetype)initWithTarget:(id)target
selector:(SEL)selector
data:(void*)data
{
[super init];
target = _target;
selector = _selector;
data = _data;
self = [super init];
return self;
}
_target = [target retain];
_selector = selector;
_data = data;
- (id)target
{
return target;
}
- (SEL)selector
{
return selector;
}
- (void*)data
{
return data;
}
- (bool)dataRetained
{
return retained;
return self;
}
@end

8
src/GIR/GIRApi.h

@ -31,13 +31,13 @@
#import "GIRNamespace.h"
@interface GIRApi : GIRBase {
OFString* version;
OFString* cInclude;
OFMutableArray* namespaces;
OFString* _version;
OFString* _cInclude;
OFMutableArray* _namespaces;
}
@property (nonatomic, retain) OFString* version;
@property (nonatomic, retain) OFString* cInclude;
@property (nonatomic, retain) OFMutableArray* namespaces;
@property (nonatomic, retain) OFArray* namespaces;
@end

25
src/GIR/GIRApi.m

@ -29,17 +29,16 @@
@implementation GIRApi
@synthesize version;
@synthesize cInclude;
@synthesize namespaces;
@synthesize version = _version;
@synthesize cInclude = _cInclude;
- (id)init
- (instancetype)init
{
self = [super init];
@try {
elementTypeName = @"GIRApi";
namespaces = [[OFMutableArray alloc] init];
_elementTypeName = @"GIRApi";
_namespaces = [[OFMutableArray alloc] init];
} @catch (id e) {
[self release];
@throw e;
@ -78,18 +77,24 @@
} else if ([key isEqual:@"namespace"]) {
[self processArrayOrDictionary:value
withClass:[GIRNamespace class]
andArray:namespaces];
andArray:_namespaces];
} else {
[self logUnknownElement:key];
}
}
}
- (OFArray*)namespaces
{
return [[_namespaces copy] autorelease];
}
- (void)dealloc
{
[version release];
[cInclude release];
[namespaces release];
[_version release];
[_cInclude release];
[_namespaces release];
[super dealloc];
}

12
src/GIR/GIRArray.h

@ -31,12 +31,12 @@
#import "GIRType.h"
@interface GIRArray : GIRBase {
OFString* cType;
OFString* name;
int length;
int fixedSize;
bool zeroTerminated;
GIRType* type;
OFString* _cType;
OFString* _name;
int _length;
int _fixedSize;
bool _zeroTerminated;
GIRType* _type;
}
@property (nonatomic, retain) OFString* cType;

26
src/GIR/GIRArray.m

@ -29,19 +29,19 @@
@implementation GIRArray
@synthesize cType;
@synthesize name;
@synthesize length;
@synthesize fixedSize;
@synthesize zeroTerminated;
@synthesize type;
@synthesize cType = _cType;
@synthesize name = _name;
@synthesize length = _length;
@synthesize fixedSize = _fixedSize;
@synthesize zeroTerminated = _zeroTerminated;
@synthesize type = _type;
- (id)init
- (instancetype)init
{
self = [super init];
@try {
elementTypeName = @"GIRArray";
_elementTypeName = @"GIRArray";
} @catch (id e) {
[self release];
@throw e;
@ -82,7 +82,8 @@
} else if ([key isEqual:@"zero-terminated"]) {
self.zeroTerminated = [value isEqual:@"1"];
} else if ([key isEqual:@"type"]) {
self.type = [[GIRType alloc] initWithDictionary:value];
self.type =
[[[GIRType alloc] initWithDictionary:value] autorelease];
} else {
[self logUnknownElement:key];
}
@ -91,9 +92,10 @@
- (void)dealloc
{
[cType release];
[name release];
[type release];
[_cType release];
[_name release];
[_type release];
[super dealloc];
}

4
src/GIR/GIRBase.h

@ -38,8 +38,8 @@ typedef enum LogLevel { Debug = 0, Info = 1, Warning = 2, Error = 3 } LogLevel;
@end
@interface GIRBase : OFObject <GIRParseDictionary> {
OFString* elementTypeName;
OFMutableDictionary* unknownElements;
OFString* _elementTypeName;
OFMutableDictionary* _unknownElements;
}
@property (nonatomic, copy) OFString* elementTypeName;

17
src/GIR/GIRBase.m

@ -29,19 +29,19 @@
@implementation GIRBase
@synthesize elementTypeName;
@synthesize unknownElements;
@synthesize elementTypeName = _elementTypeName;
@synthesize unknownElements = _unknownElements;
LogLevel _logLevel = Info;
static LogLevel logLevel = Info;
+ (void)setLogLevel:(LogLevel)level
{
_logLevel = level;
logLevel = level;
}
+ (void)log:(OFString*)message andLevel:(LogLevel)level
{
if (level >= _logLevel) {
if (level >= logLevel) {
OFString* levelDescription = nil;
switch (level) {
@ -120,10 +120,9 @@ LogLevel _logLevel = Info;
- (void)dealloc
{
[elementTypeName release];
if (unknownElements != nil) {
[unknownElements release];
}
[_elementTypeName release];
[_unknownElements release];
[super dealloc];
}

28
src/GIR/GIRClass.h

@ -38,20 +38,20 @@
#import "GIRVirtualMethod.h"
@interface GIRClass : GIRBase {
OFString* name;
OFString* cType;
OFString* cSymbolPrefix;
OFString* parent;
OFString* version;
bool abstract;
GIRDoc* doc;
OFMutableArray* constructors;
OFMutableArray* fields;
OFMutableArray* methods;
OFMutableArray* virtualMethods;
OFMutableArray* properties;
OFMutableArray* implements;
OFMutableArray* functions;
OFString* _name;
OFString* _cType;
OFString* _cSymbolPrefix;
OFString* _parent;
OFString* _version;
bool _abstract;
GIRDoc* _doc;
OFMutableArray* _constructors;
OFMutableArray* _fields;
OFMutableArray* _methods;
OFMutableArray* _virtualMethods;
OFMutableArray* _properties;
OFMutableArray* _implements;
OFMutableArray* _functions;
}
@property (nonatomic, copy) OFString* name;

87
src/GIR/GIRClass.m

@ -29,34 +29,34 @@
@implementation GIRClass
@synthesize name;
@synthesize cType;
@synthesize cSymbolPrefix;
@synthesize parent;
@synthesize version;
@synthesize abstract;
@synthesize doc;
@synthesize constructors;
@synthesize fields;
@synthesize methods;
@synthesize virtualMethods;
@synthesize properties;
@synthesize implements;
@synthesize functions;
@synthesize name = _name;
@synthesize cType = _cType;
@synthesize cSymbolPrefix = _cSymbolPrefix;
@synthesize parent = _parent;
@synthesize version = _version;
@synthesize abstract = _abstract;
@synthesize doc = _doc;
@synthesize constructors = _constructors;
@synthesize fields = _fields;
@synthesize methods = _methods;
@synthesize virtualMethods = _virtualMethods;
@synthesize properties = _properties;
@synthesize implements = _implements;
@synthesize functions = _functions;
- (id)init
- (instancetype)init
{
self = [super init];
@try {
elementTypeName = @"GIRClass";
constructors = [[OFMutableArray alloc] init];
fields = [[OFMutableArray alloc] init];
methods = [[OFMutableArray alloc] init];
virtualMethods = [[OFMutableArray alloc] init];
properties = [[OFMutableArray alloc] init];
implements = [[OFMutableArray alloc] init];
functions = [[OFMutableArray alloc] init];
_elementTypeName = @"GIRClass";
_constructors = [[OFMutableArray alloc] init];
_fields = [[OFMutableArray alloc] init];
_methods = [[OFMutableArray alloc] init];
_virtualMethods = [[OFMutableArray alloc] init];
_properties = [[OFMutableArray alloc] init];
_implements = [[OFMutableArray alloc] init];
_functions = [[OFMutableArray alloc] init];
} @catch (id e) {
[self release];
@throw e;
@ -107,31 +107,31 @@
} else if ([key isEqual:@"constructor"]) {
[self processArrayOrDictionary:value
withClass:[GIRConstructor class]
andArray:constructors];
andArray:_constructors];
} else if ([key isEqual:@"field"]) {
[self processArrayOrDictionary:value
withClass:[GIRField class]
andArray:fields];
andArray:_fields];
} else if ([key isEqual:@"method"]) {
[self processArrayOrDictionary:value
withClass:[GIRMethod class]
andArray:methods];
andArray:_methods];
} else if ([key isEqual:@"virtual-method"]) {
[self processArrayOrDictionary:value
withClass:[GIRVirtualMethod class]
andArray:virtualMethods];
andArray:_virtualMethods];
} else if ([key isEqual:@"property"]) {
[self processArrayOrDictionary:value
withClass:[GIRProperty class]
andArray:properties];
andArray:_properties];
} else if ([key isEqual:@"implements"]) {
[self processArrayOrDictionary:value
withClass:[GIRImplements class]
andArray:implements];
andArray:_implements];
} else if ([key isEqual:@"function"]) {
[self processArrayOrDictionary:value
withClass:[GIRFunction class]
andArray:functions];
andArray:_functions];
} else {
[self logUnknownElement:key];
}
@ -140,19 +140,20 @@
- (void)dealloc
{
[name release];
[cType release];
[cSymbolPrefix release];
[parent release];
[version release];
[doc release];
[constructors release];
[fields release];
[methods release];
[virtualMethods release];
[properties release];
[implements release];
[functions release];
[_name release];
[_cType release];
[_cSymbolPrefix release];
[_parent release];
[_version release];
[_doc release];
[_constructors release];
[_fields release];
[_methods release];
[_virtualMethods release];
[_properties release];
[_implements release];
[_functions release];
[super dealloc];
}

18
src/GIR/GIRConstant.h

@ -32,15 +32,15 @@
#import "GIRType.h"
@interface GIRConstant : GIRBase {
OFString* cType;
OFString* name;
OFString* theValue;
OFString* version;
OFString* deprecatedVersion;
bool deprecated;
GIRDoc* doc;
GIRDoc* docDeprecated;
GIRType* type;
OFString* _cType;
OFString* _name;
OFString* _theValue;
OFString* _version;
OFString* _deprecatedVersion;
bool _deprecated;
GIRDoc* _doc;
GIRDoc* _docDeprecated;
GIRType* _type;
}
@property (nonatomic, retain) OFString* cType;

41
src/GIR/GIRConstant.m

@ -29,22 +29,22 @@
@implementation GIRConstant
@synthesize cType;
@synthesize name;
@synthesize theValue;
@synthesize version;
@synthesize deprecatedVersion;
@synthesize deprecated;
@synthesize doc;
@synthesize docDeprecated;
@synthesize type;
@synthesize cType = _cType;
@synthesize name = _name;
@synthesize theValue = _theValue;
@synthesize version = _version;
@synthesize deprecatedVersion = _deprecatedVersion;
@synthesize deprecated = _deprecated;
@synthesize doc = _doc;
@synthesize docDeprecated = _docDeprecated;
@synthesize type = _type;
- (id)init
- (instancetype)init
{
self = [super init];
@try {
elementTypeName = @"GIRConstant";
_elementTypeName = @"GIRConstant";
} @catch (id e) {
[self release];
@throw e;
@ -88,7 +88,7 @@
} else if ([key isEqual:@"deprecated"]) {
self.deprecated = [value isEqual:@"1"];
} else if ([key isEqual:@"doc"]) {
self.doc = [[GIRDoc alloc] initWithDictionary:value];
self.doc = [[[GIRDoc alloc] initWithDictionary:value] autorelease];
} else if ([key isEqual:@"doc-deprecated"]) {
self.docDeprecated =
[[[GIRDoc alloc] initWithDictionary:value] autorelease];
@ -103,14 +103,15 @@
- (void)dealloc
{
[cType release];
[name release];
[theValue release];
[version release];
[deprecatedVersion release];
[doc release];
[docDeprecated release];
[type release];
[_cType release];
[_name release];
[_theValue release];
[_version release];
[_deprecatedVersion release];
[_doc release];
[_docDeprecated release];
[_type release];
[super dealloc];
}

28
src/GIR/GIRConstructor.h

@ -33,20 +33,20 @@
#import "GIRReturnValue.h"
@interface GIRConstructor : GIRBase {
OFString* name;
OFString* cIdentifier;
OFString* version;
OFString* deprecatedVersion;
OFString* shadowedBy;
OFString* shadows;
bool introspectable;
bool deprecated;
bool throws;
GIRDoc* doc;
GIRDoc* docDeprecated;
GIRReturnValue* returnValue;
OFMutableArray* parameters;
OFMutableArray* instanceParameters;
OFString* _name;
OFString* _cIdentifier;
OFString* _version;
OFString* _deprecatedVersion;
OFString* _shadowedBy;
OFString* _shadows;
bool _introspectable;
bool _deprecated;
bool _throws;
GIRDoc* _doc;
GIRDoc* _docDeprecated;
GIRReturnValue* _returnValue;
OFMutableArray* _parameters;
OFMutableArray* _instanceParameters;
}
@property (nonatomic, retain) OFString* name;

59
src/GIR/GIRConstructor.m

@ -29,28 +29,28 @@
@implementation GIRConstructor
@synthesize name;
@synthesize cIdentifier;
@synthesize version;
@synthesize deprecatedVersion;
@synthesize shadowedBy;
@synthesize shadows;
@synthesize introspectable;
@synthesize deprecated;
@synthesize throws;
@synthesize doc;
@synthesize docDeprecated;
@synthesize returnValue;
@synthesize parameters;
@synthesize instanceParameters;
@synthesize name = _name;
@synthesize cIdentifier = _cIdentifier;
@synthesize version = _version;
@synthesize deprecatedVersion = _deprecatedVersion;
@synthesize shadowedBy = _shadowedBy;
@synthesize shadows = _shadows;
@synthesize introspectable = _introspectable;
@synthesize deprecated = _deprecated;
@synthesize throws = _throws;
@synthesize doc = _doc;
@synthesize docDeprecated = _docDeprecated;
@synthesize returnValue = _returnValue;
@synthesize parameters = _parameters;
@synthesize instanceParameters = _instanceParameters;
- (id)init
- (instancetype)init
{
self = [super init];
@try {
elementTypeName = @"GIRConstructor";
parameters = [[OFMutableArray alloc] init];
_elementTypeName = @"GIRConstructor";
_parameters = [[OFMutableArray alloc] init];
} @catch (id e) {
[self release];
@throw e;
@ -110,11 +110,11 @@
if ([paramKey isEqual:@"parameter"]) {
[self processArrayOrDictionary:[value objectForKey:paramKey]
withClass:[GIRParameter class]
andArray:parameters];
andArray:_parameters];
} else if ([paramKey isEqual:@"instance-parameter"]) {
[self processArrayOrDictionary:[value objectForKey:paramKey]
withClass:[GIRParameter class]
andArray:instanceParameters];
andArray:_instanceParameters];
}
}
} else {
@ -125,16 +125,17 @@
- (void)dealloc
{
[name release];
[cIdentifier release];
[version release];
[deprecatedVersion release];
[shadowedBy release];
[shadows release];
[doc release];
[docDeprecated release];
[parameters release];
[instanceParameters release];
[_name release];
[_cIdentifier release];
[_version release];
[_deprecatedVersion release];
[_shadowedBy release];
[_shadows release];
[_doc release];
[_docDeprecated release];
[_parameters release];
[_instanceParameters release];
[super dealloc];
}

6
src/GIR/GIRDoc.h

@ -30,9 +30,9 @@
#import "GIRBase.h"
@interface GIRDoc : GIRBase {
OFString* xmlSpace;
OFString* xmlWhitespace;
OFString* docText;
OFString* _xmlSpace;
OFString* _xmlWhitespace;
OFString* _docText;
}
@property (nonatomic, retain) OFString* xmlSpace;

17
src/GIR/GIRDoc.m

@ -29,15 +29,15 @@
@implementation GIRDoc
@synthesize xmlSpace;
@synthesize xmlWhitespace;
@synthesize docText;
@synthesize xmlSpace = _xmlSpace;
@synthesize xmlWhitespace = _xmlWhitespace;
@synthesize docText = _docText;
- (id)init
- (instancetype)init
{
self = [super init];
elementTypeName = @"GIRDoc";
_elementTypeName = @"GIRDoc";
return self;
}
@ -77,9 +77,10 @@
- (void)dealloc
{
[xmlSpace release];
[xmlWhitespace release];
[docText release];
[_xmlSpace release];
[_xmlWhitespace release];
[_docText release];
[super dealloc];
}

18
src/GIR/GIREnumeration.h

@ -33,15 +33,15 @@
#import "GIRMember.h"
@interface GIREnumeration : GIRBase {
OFString* cType;
OFString* name;
OFString* version;
OFString* deprecatedVersion;
bool deprecated;
GIRDoc* doc;
GIRDoc* docDeprecated;
OFMutableArray* members;
OFMutableArray* functions;
OFString* _cType;
OFString* _name;
OFString* _version;
OFString* _deprecatedVersion;
bool _deprecated;
GIRDoc* _doc;
GIRDoc* _docDeprecated;
OFMutableArray* _members;
OFMutableArray* _functions;
}
@property (nonatomic, retain) OFString* cType;

65
src/GIR/GIREnumeration.m

@ -29,24 +29,24 @@
@implementation GIREnumeration
@synthesize cType;
@synthesize name;
@synthesize version;
@synthesize deprecatedVersion;
@synthesize deprecated;
@synthesize doc;
@synthesize docDeprecated;
@synthesize members;
@synthesize functions;
- (id)init
@synthesize cType = _cType;
@synthesize name = _name;
@synthesize version = _version;
@synthesize deprecatedVersion = _deprecatedVersion;
@synthesize deprecated = _deprecated;
@synthesize doc = _doc;
@synthesize docDeprecated = _docDeprecated;
@synthesize members = _members;
@synthesize functions = _functions;
- (instancetype)init
{
self = [super init];
@try {
elementTypeName = @"GIREnumeration";
members = [[OFMutableArray alloc] init];
functions = [[OFMutableArray alloc] init];
_elementTypeName = @"GIREnumeration";
_members = [[OFMutableArray alloc] init];
_functions = [[OFMutableArray alloc] init];
} @catch (id e) {
[self release];
@throw e;
@ -96,11 +96,11 @@
} else if ([key isEqual:@"member"]) {
[self processArrayOrDictionary:value
withClass:[GIRMember class]
andArray:members];
andArray:_members];
} else if ([key isEqual:@"function"]) {
[self processArrayOrDictionary:value
withClass:[GIRFunction class]
andArray:functions];
andArray:_functions];
} else {
[self logUnknownElement:key];
}
@ -112,13 +112,13 @@
[GIRBase log:@"Adding member" andLevel:Debug];
// Create the array if this is the first time through
if (members == nil) {
members = [[OFMutableArray alloc] init];
if (_members == nil) {
_members = [[OFMutableArray alloc] init];
}
if ([object isKindOfClass:[OFDictionary class]]) {
[members addObject:[[[GIRMember alloc] initWithDictionary:object]
autorelease]];
[_members addObject:[[[GIRMember alloc] initWithDictionary:object]
autorelease]];
}
}
@ -127,26 +127,27 @@
[GIRBase log:@"Adding function" andLevel:Debug];
// Create the array if this is the first time through
if (functions == nil) {
functions = [[OFMutableArray alloc] init];
if (_functions == nil) {
_functions = [[OFMutableArray alloc] init];
}
if ([object isKindOfClass:[OFDictionary class]]) {
[functions addObject:[[[GIRFunction alloc] initWithDictionary:object]
autorelease]];
[_functions addObject:[[[GIRFunction alloc] initWithDictionary:object]
autorelease]];
}
}
- (void)dealloc
{
[cType release];
[name release];
[version release];
[deprecatedVersion release];
[doc release];
[docDeprecated release];
[members release];
[functions release];
[_cType release];
[_name release];
[_version release];
[_deprecatedVersion release];
[_doc release];
[_docDeprecated release];
[_members release];
[_functions release];
[super dealloc];
}

12
src/GIR/GIRField.h

@ -32,12 +32,12 @@
#import "GIRType.h"
@interface GIRField : GIRBase {
OFString* name;
bool isPrivate;
bool readable;
int bits;
GIRType* type;
GIRArray* array;
OFString* _name;
bool _isPrivate;
bool _readable;
int _bits;
GIRType* _type;
GIRArray* _array;
}
@property (nonatomic, retain) OFString* name;

23
src/GIR/GIRField.m

@ -29,18 +29,18 @@
@implementation GIRField
@synthesize name;
@synthesize isPrivate;
@synthesize readable;
@synthesize bits;
@synthesize type;
@synthesize array;
@synthesize name = _name;
@synthesize isPrivate = _isPrivate;
@synthesize readable = _readable;
@synthesize bits = _bits;
@synthesize type = _type;
@synthesize array = _array;
- (id)init
- (instancetype)init
{
self = [super init];
elementTypeName = @"GIRField";
_elementTypeName = @"GIRField";
return self;
}
@ -88,9 +88,10 @@
- (void)dealloc
{
[name release];
[type release];
[array release];
[_name release];
[_type release];
[_array release];
[super dealloc];
}

26
src/GIR/GIRFunction.h

@ -33,19 +33,19 @@
#import "GIRReturnValue.h"
@interface GIRFunction : GIRBase {
OFString* name;
OFString* cIdentifier;
OFString* movedTo;
OFString* version;
bool introspectable;
bool deprecated;
OFString* deprecatedVersion;
bool throws;
GIRDoc* docDeprecated;
GIRDoc* doc;
GIRReturnValue* returnValue;
OFMutableArray* parameters;
OFMutableArray* instanceParameters;
OFString* _name;
OFString* _cIdentifier;
OFString* _movedTo;
OFString* _version;
bool _introspectable;
bool _deprecated;
OFString* _deprecatedVersion;
bool _throws;
GIRDoc* _docDeprecated;
GIRDoc* _doc;
GIRReturnValue* _returnValue;
OFMutableArray* _parameters;
OFMutableArray* _instanceParameters;
}
@property (nonatomic, retain) OFString* name;

57
src/GIR/GIRFunction.m

@ -29,28 +29,28 @@
@implementation GIRFunction
@synthesize name;
@synthesize cIdentifier;
@synthesize movedTo;
@synthesize version;
@synthesize introspectable;
@synthesize deprecated;
@synthesize deprecatedVersion;
@synthesize throws;
@synthesize docDeprecated;
@synthesize doc;
@synthesize returnValue;
@synthesize parameters;
@synthesize instanceParameters;
@synthesize name = _name;
@synthesize cIdentifier = _cIdentifier;
@synthesize movedTo = _movedTo;
@synthesize version = _version;
@synthesize introspectable = _introspectable;
@synthesize deprecated = _deprecated;
@synthesize deprecatedVersion = _deprecatedVersion;
@synthesize throws = _throws;
@synthesize docDeprecated = _docDeprecated;
@synthesize doc = _doc;
@synthesize returnValue = _returnValue;
@synthesize parameters = _parameters;
@synthesize instanceParameters = _instanceParameters;
- (id)init
{
self = [super init];
@try {
elementTypeName = @"GIRFunction";
parameters = [[OFMutableArray alloc] init];
instanceParameters = [[OFMutableArray alloc] init];
_elementTypeName = @"GIRFunction";
_parameters = [[OFMutableArray alloc] init];
_instanceParameters = [[OFMutableArray alloc] init];
} @catch (id e) {
[self release];
@throw e;
@ -108,11 +108,11 @@
if ([paramKey isEqual:@"parameter"]) {
[self processArrayOrDictionary:[value objectForKey:paramKey]
withClass:[GIRParameter class]
andArray:parameters];
andArray:_parameters];
} else if ([paramKey isEqual:@"instance-parameter"]) {
[self processArrayOrDictionary:[value objectForKey:paramKey]
withClass:[GIRParameter class]
andArray:instanceParameters];
andArray:_instanceParameters];
}
}
} else {
@ -123,16 +123,17 @@
- (void)dealloc
{
[name release];
[cIdentifier release];
[movedTo release];
[version release];
[deprecatedVersion release];
[docDeprecated release];
[doc release];
[returnValue release];
[parameters release];
[instanceParameters release];
[_name release];
[_cIdentifier release];
[_movedTo release];
[_version release];
[_deprecatedVersion release];
[_docDeprecated release];
[_doc release];
[_returnValue release];
[_parameters release];
[_instanceParameters release];
[super dealloc];
}

2
src/GIR/GIRImplements.h

@ -30,7 +30,7 @@
#import "GIRBase.h"
@interface GIRImplements : GIRBase {
OFString* name;
OFString* _name;
}
@property (nonatomic, retain) OFString* name;

7
src/GIR/GIRImplements.m

@ -29,13 +29,13 @@
@implementation GIRImplements
@synthesize name;
@synthesize name = _name;
- (id)init
{
self = [super init];
elementTypeName = @"GIRImplements";
_elementTypeName = @"GIRImplements";
return self;
}
@ -71,7 +71,8 @@
- (void)dealloc
{
[name release];
[_name release];