0

so im thinking about porting some logic written for my ios app to the server. I am building a view hierachy and then rasterizing it to bitmaps

I have used chameleon to successfully port the relevant bits to mac os.

and now I would like to try porting this to ubuntu using since GNUstep has an open implementation on AppKit. I managed to get the hello world app working. However, It seemed strange to me than the following throws errors on compiling.

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

int main (int argc, const char * argv[])
{
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    [NSApplication sharedApplication];
        NSRunAlertPanel(@"Random",@"hello from GNUStep Appkit!",@"close this window",@"Another Button",nil);
    NSView *view = [[NSView alloc]init];
    view.layer;
    CGRect rect;
        [pool drain];
        return 0;
}

Errors:

hello.m: In function ‘main’:
hello.m:10:6: error: request for member ‘layer’ in something not a structure or union
hello.m:11:2: error: unknown type name ‘CGRect’

It seems strange to me that these errors should be thrown, as I believed coregraphics to sit below AppKit. Am I missing a particular module in gnustep?

tzl
  • 1,540
  • 2
  • 20
  • 31

1 Answers1

0

As far as I know, CoreGraphics is not implemented in GNUstep; I believe though that Cocotron has an implementation.

The error error: request for member ‘layer’ in something not a structure or union refers to the expression view.layer, which you intended to return the layer property from the view object. That syntax is from Objective-C 2.0, which wasn't supported out of the box with GNUstep, last I knew; check ObjC2FAQ for information about enabling it (and what its limitations on GNUstep are).

In the meantime, you can instead use the original Objective-C syntax: [view layer].

echristopherson
  • 6,974
  • 2
  • 21
  • 31
  • GNUstep's CoreGraphics implementation is called Opal. – Fred Frith-MacDonald Apr 22 '13 at 22:19
  • thanks for the info. guess i have to read up more on gnustep history. thanks fred for the heads up. after investigating opal and cocotron, i find that neither cocotron nor opal's implementation of corgraphics is complete enough for my needs :( Considering the amount of additional work i have to do to TRY and get it to port successfully with no guarantees of success, i might as well write something to run on ubuntu from scratch :/ – tzl Apr 23 '13 at 02:36