diff --git a/configure b/configure index 0371bcd..0c17663 100755 --- a/configure +++ b/configure @@ -38,7 +38,6 @@ require("./pl/utils.pl"); param_set("classic-theme", 0); param_set("stb-image", 1); -param_set("stb-truetype", 0); param_set("xrender", 1); param_set("opengl", 0); param_set("vulkan", 0); @@ -50,6 +49,9 @@ param_set("examples", 1); if($target ne "Darwin") { param_set("freetype2", 1); + param_set("stb-truetype", 0); +} else { + param_set("stb-truetype", 1); } my %features = ( diff --git a/include/Mw/LowLevel/Cocoa.h b/include/Mw/LowLevel/Cocoa.h index da104f0..6e51c30 100644 --- a/include/Mw/LowLevel/Cocoa.h +++ b/include/Mw/LowLevel/Cocoa.h @@ -86,18 +86,17 @@ @end @interface MilskoCocoaView : NSView { - NSBitmapImageRep* rep; - NSGraphicsContext* context; - MwBool valid; - CGColorSpaceRef space; - CGDataProviderRef provider; - NSRect givenRect; - float x; - float y; - float width; - float height; - MwBool _child; - IBOutlet NSViewController* viewController; + NSBitmapImageRep* rep; + NSGraphicsContext* context; + MwBool valid; + CGColorSpaceRef space; + CGDataProviderRef provider; + NSRect givenRect; + float x; + float y; + float width; + float height; + MwBool _child; } - (void)initRepAndContextWithWidth:(float)w Height:(float)h; diff --git a/include/Mw/MachDep.h b/include/Mw/MachDep.h index 61a6f90..50898f6 100644 --- a/include/Mw/MachDep.h +++ b/include/Mw/MachDep.h @@ -57,17 +57,26 @@ #define M_PI 3.14159265 #endif +/* Windows */ #if defined(_MILSKO) && defined(_WIN32) #define MWDECL extern __declspec(dllexport) #elif defined(_WIN32) #define MWDECL extern __declspec(dllimport) +/* GCC/Clang */ +/* First check if we have __has_attribute and can check for the existence of visibility */ #elif defined(__has_attribute) #if __has_attribute(visibility) #define MWDECL extern __attribute__((visibility("default"))) #else #define MWDECL extern #endif +/* It might be that we're on an old version of GCC (like the one Apple ships with older versions of Mac OS). + * If we're on gcc 3 or above, assume it's there + */ +#elif __GNUC__ >= 3 +#define MWDECL extern __attribute__((visibility("default"))) #else +/* all else fails */ #define MWDECL extern #endif diff --git a/pl/utils.pl b/pl/utils.pl index 70c0b51..9472123 100644 --- a/pl/utils.pl +++ b/pl/utils.pl @@ -55,6 +55,7 @@ sub new_object { my @l = glob($_[0]); foreach my $e (@l) { $e =~ s/\.(c|m)$/$object_suffix/; + print($e."\n"); push(@library_targets, $e); } } diff --git a/src/backend/cocoa.m b/src/backend/cocoa.m index 04ce17e..195e339 100644 --- a/src/backend/cocoa.m +++ b/src/backend/cocoa.m @@ -665,6 +665,9 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) { NSSize sz = [self->rep size]; MwLL ll = [((MilskoFakePointer*)[[[[self window] contentView] subviews] objectAtIndex:0]) pointer]; + NSRect bounds; + NSArray* subviews = [self subviews]; + int i; [super drawRect:dirtyRect]; if(!self->rep) { @@ -683,8 +686,9 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) { [self->rep drawInRect:dirtyRect]; - for(NSView* subview in [self subviews]) { - NSRect bounds = [subview bounds]; + for(i = 0; i < [subviews count]; i++) { + NSView* subview = [subviews objectAtIndex:i]; + bounds = [subview bounds]; [subview drawRect:bounds]; }