Development Guide

Table Of Contents
Chapter 5
|
Developing third-party FileMaker plug-ins 37
14. Click OK to close the Manage Database dialog box.
Mac OS Plug-ins created for PowerPCs need to be re-compiled as
universal binaries in order to run natively when FileMaker Pro is run
on Intel-based Mac computers. Universal binaries allow applications
to run natively on both PowerPC and Intel-based Macintoshes.
To provide universal binary support for FileMaker plug-ins for Mac
OS X, the development project provided supports only XCode 2.2 and
higher. The included XCode project uses GCC 3.3 for PPC and GCC
4.0 for Intel-based Macintoshes. FileMaker plug-ins can be developed
on Mac OS X 10.4 and work on systems using 10.2.8, 10.3.9, and
10.4.
To compile the FMExample or your custom plug-ins on Mac OS X,
perform a custom installation of XCode and select the option “Cross-
Development.
Customizing the plug-in example
The plug-in example in FileMaker Pro Advanced is designed to be
easily modified so you can add your own custom functions. You need
to modify the following items:
1 version information in FMPluginExample.strings and
FMPluginExample.rc
1 plug-in and function names in FMPluginExample.strings and
FMPluginExample.rc
1 configuration function in FMPluginPrefs.cpp
1 external function definitions and coding in
FMPluginFunctions.cpp
Customizing the example resources
You must make the following modifications to the plug-in resource
files to create a custom external function plug-in:
1 Modify the version variables and strings to meet your needs.
1 Revise the configuration dialog box to meet your needs.
1 Specify the correct option string values.
1 Edit plug-in names and description.
1 Define your function names and function prototypes.
Customizing FMPluginExample.cpp
Make your modifications to the FMPluginExample.cpp in the
functions listed in the following table.
Customizing FMPluginPrefs.cpp
This file contains the Do_PluginPrefs function for the implementation
of the configuration dialog box. Revise or remove this code as needed.
Customizing FMPluginFunctions.cpp
Revise or remove the functions provided in the FMPluginFunctions.cpp
file and define your own. Do_PluginInit refers to these functions when
evaluating external functions in calculations.
Function name Customization
Do_PluginInit Provide your own unique plug-in ID for “pluginID.”
Register each function, providing its name,
description, and function to be used. Call
fmx::ExprEnv::RegisterExternalFunction to register
your functions.
Do_PluginIdle Add any idle processing your plug-in needs.
Do_PluginShutdown Revise the UnRegisterExternalFunction calls to
reverse the registration done in Do_PlugInit. Call
fmx::ExprEnv::UnRegisterExternalFunction to
unregister your functions.