Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Build artifacts
obj/
derived_src/

# Framework output
*.framework/

# Application bundles
*.app/
15 changes: 0 additions & 15 deletions Demo/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,12 @@
#import <AppKit/NSWindow.h>
#import <AppKit/NSOpenGL.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSMenu.h>
#import "DemoOpenGLView.h"
#import "AppController.h"

@implementation AppController
-(void)applicationDidFinishLaunching: (NSNotification*)aNote
{
#if GNUSTEP
NSMenu * menu = [[NSMenu alloc] initWithTitle: @"Main Menu"];

[menu addItemWithTitle: @"GSQCDemo"
action: @selector(orderFrontStandardAboutPanel:)
keyEquivalent: @""];
[menu addItemWithTitle: @"Quit"
action: @selector(terminate:)
keyEquivalent: @"q"];

[NSApp setMainMenu: menu];
[menu release];
#endif

_window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0,0,800,600)
styleMask: NSTitledWindowMask | NSClosableWindowMask
backing: NSBackingStoreBuffered
Expand Down
2 changes: 1 addition & 1 deletion Demo/DemoOpenGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ - (void) prepareOpenGL
CALayer * layer = [CALayer layer];
[_renderer setLayer: layer];
[layer setBounds: NSRectToCGRect([self bounds])];
[layer setBackgroundColor: whiteColor];
[layer setBackgroundColor: whiteColor];
CGPoint midPos = CGPointMake([_renderer bounds].size.width/2,
[_renderer bounds].size.height/2);
[layer setPosition: midPos];
Expand Down
4 changes: 2 additions & 2 deletions Demo/QuartzCoreDemoInfo.plist
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
ApplicationDescription = "Demonstration of GNUstep QuartzCore";
ApplicationName = GSQuartzCoreDemo;
ApplicationName = QuartzCoreDemo;
ApplicationRelease = 1.0;
Authors = (
"Ivan Vucica <ivan@vucica.net>"
);
Copyright = "Copyright (C) 2012 Free Software Foundation";
CopyrightDescription = "Released under GNU Lesser General Public License v2.1 or later";
FullVersionID = 1.0;
NSExecutable = GSQuartzCoreDemo;
NSExecutable = QuartzCoreDemo;
NSPrincipalClass = NSApplication;
NSRole = Application;
URL = "http://www.gnustep.org/";
Expand Down
5 changes: 5 additions & 0 deletions Headers/QuartzCore/CABase.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
Boston, MA 02110-1301, USA.
*/

/* Import Foundation first so CoreFoundation.h inline functions
can resolve NSObject method signatures (-hash, -isEqual:, etc.) */
#ifdef __OBJC__
#import <Foundation/NSObject.h>
#endif
#import <CoreFoundation/CoreFoundation.h>

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion Headers/QuartzCore/CATransaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

#import <Foundation/Foundation.h>
#import "CoreFoundation/CFDate.h" /* CFTimeInterval */
#import <CoreFoundation/CoreFoundation.h> /* CFTimeInterval */

@class CAMediaTimingFunction;

Expand Down
3 changes: 2 additions & 1 deletion Source/CABackingStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
#if GNUSTEP
#import <CoreGraphics/CoreGraphics.h>
#endif
#if (__APPLE__)
#define GL_GLEXT_PROTOTYPES 1
#if (__APPLE__)
#import <OpenGL/OpenGL.h>
#import <OpenGL/gl.h>
#import <OpenGL/glu.h>
#else
#import <GL/gl.h>
#import <GL/glu.h>
#import <GL/glext.h>
#endif

@class CAGLTexture;
Expand Down
76 changes: 52 additions & 24 deletions Source/CALayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ - (id) init
_observedKeyPaths = [[NSMutableArray alloc] init];
_dynamicPropertyValueDict = [[NSMutableDictionary alloc] init];

/* TODO: list all properties below */
/* All properties that need default values set */
static NSString * keys[] = {
@"anchorPoint", @"transform", @"sublayerTransform",
@"opacity", @"delegate", @"contentsRect", @"shouldRasterize",
Expand All @@ -287,25 +287,20 @@ - (id) init

@"bounds", @"position" };

/* Struct-typed properties must NOT be observed via KVO because
GNUstep's KVO generates setter overrides that corrupt struct
arguments passed by value through objc_msgSend. The custom
GSCA_OBSERVABLE_SETTER macro and the manual setBounds: method
already emit willChange/didChange notifications directly. */
static NSString * structKeys[] = {
@"anchorPoint", @"transform", @"sublayerTransform",
@"contentsRect", @"shadowOffset", @"bounds", @"position" };

for (int i = 0; i < sizeof(keys)/sizeof(keys[0]); i++)
{
id defaultValue = [[self class] defaultValueForKey: keys[i]];
if (defaultValue)
{

#if 0
NSString * setter = [NSString stringWithFormat:@"set%@%@:", [[keys[i] substringToIndex: 1] uppercaseString], [keys[i] substringFromIndex: 1]];

if (![self respondsToSelector: NSSelectorFromString(setter)])
{
NSLog(@"Key %@ is missing setter", keys[i]);
}
else
{
NSLog(@"setter %@ found", setter);
}
#endif

if ([@"shadowOffset" isEqualToString: keys[i]])
{
/* TODO(ivucica): remove this block once #53994 is resolved */
Expand All @@ -320,22 +315,55 @@ - (id) init
[self setShadowOffset: [defaultValue sizeValue]];
NS_ENDHANDLER
}
else if ([@"transform" isEqualToString: keys[i]])
{
NS_DURING
[self setValue: defaultValue
forKey: keys[i]];
NS_HANDLER
[self setTransform: [defaultValue CATransform3DValue]];
NS_ENDHANDLER
}
else if ([@"sublayerTransform" isEqualToString: keys[i]])
{
NS_DURING
[self setValue: defaultValue
forKey: keys[i]];
NS_HANDLER
[self setSublayerTransform: [defaultValue CATransform3DValue]];
NS_ENDHANDLER
}
else
{
[self setValue: defaultValue
forKey: keys[i]];
}
}

/* implicit animations support */
/* TODO: only animatable properties should be observed */
/* TODO: @dynamically created properties also need to be
set up and observed. */
[self addObserver: [CAImplicitAnimationObserver sharedObserver]
forKeyPath: keys[i]
options: NSKeyValueObservingOptionOld
context: nil];
[_observedKeyPaths addObject: keys[i]];
/* Set up KVO observation for non-struct properties only */
BOOL isStructKey = NO;
for (int j = 0; j < sizeof(structKeys)/sizeof(structKeys[0]); j++)
{
if ([keys[i] isEqualToString: structKeys[j]])
{
isStructKey = YES;
break;
}
}
if (!isStructKey)
{
NS_DURING
[self addObserver: [CAImplicitAnimationObserver sharedObserver]
forKeyPath: keys[i]
options: NSKeyValueObservingOptionOld
context: nil];
[_observedKeyPaths addObject: keys[i]];
NS_HANDLER
/* Some property types (e.g. CGColorRef) may not support
automatic KVO observation. Properties with custom setters
handle change notifications directly. */
NS_ENDHANDLER
}
}

}
Expand Down
4 changes: 4 additions & 0 deletions Source/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ QuartzCore_RESOURCE_FILES = \
QuartzCore_OBJC_FILES = $(wildcard *.m) $(wildcard GLHelpers/*.m)

QuartzCore_OBJCFLAGS += $(WARN_FLAGS)
# Newer clang treats -Wint-conversion as a hard error; suppress for
# CoreFoundation.h compatibility shim which has type mismatches in
# inline functions (CFEqual returns Boolean but message send returns id).
QuartzCore_OBJCFLAGS += -Wno-error=int-conversion
# Treat warnings as errors unless someone chooses to ignore them.
#ifneq ($(nonstrict), yes)
#QuartzCore_OBJCFLAGS += -Werror
Expand Down
4 changes: 0 additions & 4 deletions config.make

This file was deleted.