Hot Door CORE Forum
Using XCODE with core - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: Getting started (http://hotdoorcore.com/forum/forumdisplay.php?fid=6)
+--- Thread: Using XCODE with core (/showthread.php?tid=6)

Pages: 1 2 3 4


Using XCODE with core - VincentDoan - 02-26-2014

Hi,

I had the pleasure to know Brendon on the AI sdk forum, who helped me get started on CORE. A little self introduction is need: I am Vincent Doan, graduated as BSEE in 1985, worked for various high tech companies as software, hardware and ASIC designer, last employment was with Hewlett Packard in 2006, half of awaking hours on creating wood art, the other half writing AI software, several plug-ins completed for Windows only, one is available on amazoncanvas.com, eager to get start with CORE. Today? downloading Xcode 4.6.3., and CORE, use CORE GUI API (hate to convert .rc to .r file) to replace current ADM API, and keep other AI SDK unmodified, hope that in a week will support all CS version both OSes.
Is this a good plan?

Let's hope so,

Vincent


RE: Using XCODE with core - brendon - 02-26-2014

(02-26-2014, 12:55 PM)VincentDoan Wrote:
downloading Xcode 4.6.3., and CORE, use CORE GUI API (hate to convert .rc to .r file) to replace current ADM API, and keep other AI SDK unmodified

Hello Vincent,

Welcome to Hot Door CORE! Unfortunately, you're still going to have to convert your .rc file. The simplest way, by far, is to get a good text editor, such as Sublime or TextMate, that has column select. Then, conversion will be quick and painless.

Please let us know if you have any questions as you move along.

Brendon


RE: Using XCODE with core - VincentDoan - 02-26-2014

Hi Brendon,

I have lots of .cur cursor file from .rc to convert to the 64-byte format .r file requires and I have been searching for how to do that. in .r file, I am surprised that cursor can not be specified with an image, .png, .cur etc instead of this cryptic 64-byte format. Is there an app that takes in .cur and convert to 64-byte format?
By the way, it seems the CORE is aimed at new AI plug-in development, for my case can I just use its GUI API, because it is very time consuming to port everything to CORE?


RE: Using XCODE with core - VincentDoan - 02-26-2014

Updating my progress on CORE.
My mac has Xcode 4.6.3 already installed, so left it there.
Got Xcode 3.2.6 and XcodeLegacy.sh downloaded and place in the same dir as previous download of Xcode 4.6.3.
With the two Xcode dmg files I successfully ran XcodeLegacy (makepackages and install).
It created xcode_3.2.6_llvm-gcc4.2.pkg and few other .tar.gz files.
I am new with Mac, so please tell me what is the next step?
Ultimately we want to have Xcode 4.6.3 with options to set the Base SDK in Build to OS X 10.4, OS X 10.5, OS X 10.6, OS X 10.7 right?


RE: Using XCODE with core - garrett - 02-27-2014

Hello Vincent,
After running the XcodeLegacy script with the "buildpackages" argument, then the "install" argument, you can run it with the "cleanpackages" argument to remove many of the package and archive files that the script created (I think some still need to be deleted manually, sorry). After doing all that, Xcode 4.6.3 (in your case) should "just work".

I am unaware of any programs to convert from *.cur to the Mac's CURS resource format. However, the CORE API works with *.png files, so you could easily switch to the hdi::core::Cursor class.

And yes, CORE is targeted at new plug-ins, but depending on your project you might be able to use CORE with minimal rewriting. Off the top of my head, you will need to use our hdi::core::pluginSetup() and hdi::core::pluginDestroy() paradigm at the very least. This will allow you to set some callbacks to receive startup and shutdown messages. From there you can use the hdi::core:Big Grinispatcher class to create annotators, notifiers, and timers with callbacks.

Once you've got that basic "plumbing" done, you can still use the AI SDK(s) where necessary. Just add them to your project so you can compile against the headers. Under the hood, CORE uses the AI SDK suites, so you can simply check if something like the sAIArt global is already acquired (and if not, acquire it yourself). If it is already acquired, do not overwrite it or release it, since CORE depends on it! In the future we might make it easier for developers to acquire/release suites, but we're not there yet.

Once you've got all your messaging handled with the Dispatcher and are compiling against the AI SDK yourself, you should be able to use our UI classes. Just make sure you're following the notes from the Skeleton sample's Plugin class. In order to maintain proper cross-platform code and cross-version functionality, it's important that you create/destroy your UI elements at specific times.

Lastly, the vast majority of CORE objects allow you to access the internal AI object that the CORE object represents. For example, the hdi::core::Art class allows access to the underlying AIArtHandle. Be careful though, because the CORE object obviously expects its underlying data to have a certain state and you don't want to e.g. nullify the AIArtHandle (as the CORE object would no longer function properly and probably crash).

I have not tried a project with this particular set up, but having designed most of CORE myself I think it will be fine. I did have this sort of use case in mind, but haven't made any samples yet since it wasn't our primary goal.

Let us know if you have questions!


RE: Using XCODE with core - VincentDoan - 02-27-2014

Hi Garrett,

Nice to meet you.

Thank you for the reply, this is a lot of useful info.
I still can't get Xcode 4.6.3 to support earlier MAC SDK. I uninstall all XCode,ran the sh script again, this time it does not do anything but report version >= 4 exist and quit. So, I install Xcode 5. Ran the script again nothing.
I am still puzzled as to why there are only 64 bytes in the CURS structure, my cursors (99 of them) are 32x32 px. Is 64 the max or it is flexible?

So, what you suggest is to start with the skeleton sample? That is the one which has emptied plugin startup, and shutdown routine.
Stuffs in startup are:

// - Check your plug-in's compatibility against the running version of Illustrator
// - Load/create preferences
// - Load/create/verify user registration
// - Subscribe to Illustrator messages and notifiers
// - Create annotators and timers
// - Create menu items (must be done during startup ONLY)
// - Create tools (must be done during startup ONLY)
The list above can be done without using CORE api?

I see the skeleton .aip is 1.5MB release windows.
There must be a good reason for this large size?

Thanks,

Vincent


RE: Using XCODE with core - VincentDoan - 02-28-2014

gear tool:

this->__gearTool.setDragCallback(HDI_CORE_CALLBACK(tool:Tonguelugin, this, __gearToolDragCB));

void tool:Tonguelugin::__gearToolDragCB()
{
}

in the old days we have:
extern AIErr toolMouseDrag( AIToolMessage *message )
{
}
So, with CORE, how do we get AIToolMessage in the callback?

Thanks,

Vincent


RE: Using XCODE with core - garrett - 03-01-2014

(02-28-2014, 11:12 PM)VincentDoan Wrote: So, with CORE, how do we get AIToolMessage in the callback?

Since CORE is meant to provide an object-oriented environment for Adobe Illustrator, it is heavily object-driven. Also, we didn't want to require CORE API users to worry about compiling/managing something like Boost.Bind for callbacks.

As such, CORE utilizes simple callbacks of the form
Code:
void MyClass::callback_function();
or
Code:
void MyClass::callback_function() const;
and data about the current state of the object(s) to which the callback relates can typically be acquired through the Plugin, Dispatcher, Illustrator, or other classes. For example, if your callback was for a text field's value changing, then simply access the hdi::core::TextField::text() member function for the pertinent TextField object from within the callback.

For the gear tool sample, you can access message data from the hdi::core:Big Grinispatcher class. You would want either the lastMessage() or lastToolMessage() member function, depending on the circumstances.


RE: Using XCODE with core - VincentDoan - 03-01-2014

Hi Garrett, thanks for the detailed reply.

Vincent


RE: Using XCODE with core - VincentDoan - 03-03-2014

I have made significant process over the weekend.
Thanks for all the helps. Need to get the Combobox and flyout menu working on the panel. Added entries to both, but could not see them.
Any example code would help.

Thanks,

Vincent