24U SimpleHighlight Plug-In 2.0 Syntax

This file describes syntax of 24U SimpleHighlight Plug-In's functions.
 

SLight_Version ( { versionFormat } )
 
Returns version string of the active 24U SimpleHighlight Plug-In, formated as requested by the parameter. Use:

"short" to get just the version number
"long" to get the plug-in name followed by its version number
"platform" to get the platform of the code currently running
 

SLight_Register ( registrationCode )
 
Attempts to unlock (register) your copy of 24U SimpleHighlight Plug-In with the specified code. If the code is valid, 24U SimpleHighlight Plug-In gets unlocked and stays in this state until you quit the FileMaker application, deactivate the plug-in, or the registration code expires. While unlocked, 24U SimpleHighlight Plug-In is fully functional and does not bother the user with a shareware reminder.
 
Returns a non-zero result when operation is not permitted.
 

SLight_Highlight( whatToHighlight ; text {; RGB ( red ; green ; blue ) ; style ; searchOptions} )
 
Finds all occurrences of whatToHighlight in text and highlights them with color and/or style defined in Preferences or in optional Parameters. All previous formatting of text remains unchanged..

whatToHighlight Subtext which should be highlighted in text
text Input text.
color Highlight color in the RGB form. Value from preferences used as default.
style Number representing style used for highlighting. Value from preferences used as default.
searchOptions Set "nocase" to ignore case of highlighted text. Default behaviour will not ignore case

Returns zero if successful, negative error code in the case of failure.
 

SLight_SolidColor( RGB ( red ; green ; blue ) {; opacity} )
 
Generates a combination of 1x1 JPEG and 1x1 PICT picture or a combination of 1x1 JPEG and 255x255 PNG if optional parameter opacity is defined. All the pixels of generated pictures have a color specified by the red, green and blue values.
To highlight a rectangular area of your layout, use this function in a calculation field of type container, and set it to enlarge its contents in both directions.

color Rectangle color in the RGB form.
opacity Opacity value. 0 means absolute transparent, 255 means absolute opaque (default)

Returns 0 if successful, negative error code in the case of failure.
 

SLight_GeneratePicture( input ; calculation { ; calculation... } )
 
Function generates a picture to a container on a basis of calculations.

input Input container or dimensions of a new picture. 2 posibilities:
 = inputContainer - Input picture. Result of GeneratePicture will be added to this picture on opacity basis. Picture in container must be in Tiff format.
 = width ; heigth - Proportions of a new blank absolutely transparent picture which will be background for GeneratePicture function.
calculation: FM calculation which can be evaluated. It must have parameters x,y which will be evaluated for each pixel of picture. This means x will be evaluated in a range from 0 to PictureWidth and y in a range from 0 to PictureHeigth.

The return value must be unsigned integer number in a range (0 - 2^32-1) which will be considered as RGBA value of a pixel.Pixel form is: (AABBGGRR)LSB in hexadecimal format.

Colors are combined in alpha channel basis. The last Calculation is a top most layer (it overlaps all previous calculations).


SLight_Draw( input ; command { ; command... } )
 
Draws a specific object to a picture.

input Same as SLight_GeneratePicture
command: Known command to draw a specific object. There is only 1 object in SHI 2.0, but others can be very easily added.
  
  "rectangle" ; PosX ; PosY ; Width ; Heigth { ; RGB ( R ; G ; B) { ; Opacity } }
  Example:
  SLight_Draw ( 320 ; 240 ; "rectangle" ; 10 ; 20 ; 300 ; 220 ; RGB (255 ; 0 ; 0) ; 128 )
     Creates a 320x240 transparent picture and draws a filled rectangle to a position [10, 20] with dimensions [300, 220] by red color which is partialy transparent.

Default color is RGB ( 255 ; 255 ; 255 ) which means white.
Default Opacity is 255 which means absolute opaque.


SLight_GetColor( container ; x ; y )

Returns a color on a x, y coordinates in picture in container.
If index is out of bounds returned value is -50 (paramErr).

Note: Picture dimensions are indexed from 0 to pictureWidth - 1 and from 0 to pictureHeigth - 1.


SLight_RGBA( RGB ( R ; G ; B ) { ; opacity } )

Returns a number in a range 0 - 2^32-1 representing RGBA color information.
The form is (AABBGGRR)LSB. This number can be used in calculations in SLight_GeneratePicture function.

Note: Default opacity is 255 - absolutely opaque