Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Jul 21, 2017 1:38 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Building Plugins Compatible with Cocoa
PostPosted: Tue Jan 10, 2012 2:22 pm 
Offline

Joined: Thu Sep 13, 2007 6:12 pm
Posts: 6
I have built a plugin and can use it to generate Carbon applications. I use the plugin creater GUI to create the plugin and place the dylib file in both the Carbon and Cocoa folders. The problem I have is that Realstudio gives the error "Compilation of APM_Float.rbp failed. Plugin "apm.rbx:0 is not supported for Mac Cocoa." when I try to build a Cocoa application with it. I am using a Mac running Lion OS, RS2011 r4 and Xcode 4. The plugin is only wrapping math type functions (i.e. not making controls and such). See code excerpt below:

#include "rb_plugin.h"

//
// declarations and functions here
//


REALmethodDefinition apm_to_formatted_string_c_def={ (REALproc) apm_to_formatted_string_c, REALnoImplementation, "apm_to_formatted_string_c(line_termination as int8, line_length as integer, byref string_length as int64, sign as integer, exponent as int64, digit_count as int64, input as ptr, output as ptr)"};

REALmethodDefinition apm_digits_to_string_c_def={ (REALproc) apm_digits_to_string_c, REALnoImplementation, "apm_digits_to_string_c(digit_count as int64, out_position as int64, input as ptr, output as ptr)"};

REALmethodDefinition apm_normalize_c_def={ (REALproc) apm_normalize_c, REALnoImplementation, "apm_normalize_c(byref digits as int64, byref exponent as int64, r as ptr)"};

REALmethodDefinition apm_fft_c_def={ (REALproc) apm_fft_c, REALnoImplementation, "apm_fft_c(power_of_two as int64, adigits as int64, a as ptr, ain as ptr, bdigits as int64, b as ptr, bin as ptr, r as ptr)"};

REALmethodDefinition apm_subtract_c_def={ (REALproc) apm_subtract_c, REALnoImplementation, "apm_subtract_c(last_digit as int64, x as ptr, y as ptr, r as ptr)"};

REALmethodDefinition apm_add_c_def={ (REALproc) apm_add_c, REALnoImplementation, "apm_add_c(byref last_digit as int64, x as ptr, y as ptr, r as ptr) as integer"};

void PluginEntry() {

REALRegisterMethod(&apm_to_formatted_string_c_def);
REALRegisterMethod(&apm_digits_to_string_c_def);
REALRegisterMethod(&apm_normalize_c_def);
REALRegisterMethod(&apm_fft_c_def);
REALRegisterMethod(&apm_subtract_c_def);
REALRegisterMethod(&apm_add_c_def);
}

I experimented to see if I could use the plugin as is with declares and build a Cocoa app. I can after preceding functions with " extern "C" ". But I have had no luck using the plugin as a plugin with Cocoa. I did notice that using declares appeared to be much slower than accessing the functions using the plugin. Any suggestions on how I can modify the plugin or development environment to work for cocoa would be most appreciated.

Thanks,


Top
 Profile  
Reply with quote  
 Post subject: Re: Building Plugins Compatible with Cocoa
PostPosted: Tue Jan 10, 2012 5:22 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
do you have a cocoa section that gets added ?
while the code may be identical for carbon & cocoa when you build the plugin it needs to have both sections

from the "Cocoa Plugins.txt" inside the Extras > Plugins SDK > Documentation

To include your plugin in an RBX, add a "Mac Cocoa" folder to your RBX file inside of the "Build Resources" folder.

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Building Plugins Compatible with Cocoa
PostPosted: Tue Jan 10, 2012 11:17 pm 
Offline

Joined: Thu Sep 13, 2007 6:12 pm
Posts: 6
I have the plugin in the Cocoa and Carbon folders under resources. I added a "Mac Cocoa" folder as recommended and put the plugin there as well. Still gives the same error when building a cocoa application. I am convinced Real Studio sees the plugin in the right place, just refuses to use it. The reason I say this is if I don't put the plugin in the cocoa folder it states that it can't find the classes (functions).


Top
 Profile  
Reply with quote  
 Post subject: Re: Building Plugins Compatible with Cocoa
PostPosted: Tue Jan 10, 2012 11:50 pm 
Offline

Joined: Thu Sep 13, 2007 6:12 pm
Posts: 6
OK, I now have it working. I had to resort to the command line version of plugin creater. The GUI version must have some bugs to work out.


Top
 Profile  
Reply with quote  
 Post subject: Re: Building Plugins Compatible with Cocoa
PostPosted: Tue Jan 10, 2012 11:52 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
AH
Actually it does
I just checked in a fix the other day that should take care of this bug

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group