home *** CD-ROM | disk | FTP | other *** search
- :-------------------------------------------------------------------------:
- : Black Belt Systems Public Interface example code with PROGRESS bar :
- : for use with Imagemaster, Image Professional, or Imagemaster F/c :
- : Last Update: January 1st, 1991 :
- : Revision Level: 1.00 :
- : Authors: Barry Chalmers, Ben Williams :
- :-------------------------------------------------------------------------:
-
- This archive contains everything needed to create a Public Interface
- module that performs a "negative" function upon the area selected by
- the user. This module is intended ONLY for developers; the image
- processors already have a negative function.
-
- This code in this example shows you how to:
-
- - Perform an operation upon a specific buffer
- - Accept an interactive area specification from the user
- - Display messages to the user on the control panel
- - Display a "progress indicator" for the operation
-
- Archive Contents:
- -----------------
- neg.rexx The ARexx routine for the Negative example
- negative The executable Public Interface module
- readme This README file
- makefile An example make file for the NEGATIVE example
- negative_list An example link list for the NEGATIVE example
- negative.c The source code for the NEGATIVE example
- vbar.o The VBAR routines (object code)
- mem.o More functions required by VBAR routines (object code)
-
- To run the example Public Interface module,
-
- (1) Copy negative to c:
- (2) Copy neg.rexx to rexx:
-
- (3) Run the image processor, load an image,
- and run the macro "rexx:neg.rexx"
-
- You will then be asked to identify an area. A progress
- bar will be displayed and then the changed area will be
- redisplayed.
-
- -----------------------------------------------------------------
-
- ==========
- Developer Information: CODING
- ==========
-
- VBAR.o is an object module that developers of Public Interface
- modules for the Imagemaster series can link with. It provides
- a graphical progress display on the Imagemaster gadget screen.
- MEM.o is also required by the VBAR routines.
-
- The jackin structure that gets passed from Imagemaster is
- formulated as follows in IM 1.11, IMFC 3.11 and IP 6.11:
-
- struct jackin
- {
- struct jackinbuff *primary; /* Points to Primary buffer structure */
- struct jackinbuff *secondary; /* Points to Secondary buffer struct */
- struct jackinbuff *undo; /* Points to UnDo buffer struct */
- struct jackinbuff *blend; /* Points to Blend buffer struct */
- struct jackinbuff *brush; /* Points to Brush buffer struct */
- unsigned char *mask; /* Points to Primary Mask */
- char jack[4]; /* 'J' 'A' 'C' 'K' */
- struct Screen *IMscr; /* Points to control panel screen */
- unsigned char pname[4]; /* Program name 'IP'00 'IM'00 'IMFC' */
- short ver[2]; /* Program version (major:minor) */
- };
-
- One of the new additions is 'IMscr' which is a pointer to the
- Imagemaster gadget screen. This is required in the PROGRESS
- routines. You should not use it except as the example shows, or
- you may trash the user's control panel.
-
-
- The following routines are available in the vbar.o object module
- ================================================================
-
- int beginvbars( struct Screen *IMscr );
- ----------------------------------------
- This needs to be called once only before any VBAR routines are
- called. It returns 0 if successful and non-zero if unsuccessful.
-
- int progressset(int n,char *text); or
- int progressaset(int n,char *text);
- -----------------------------------
- This opens a progress window on the Imagemaster gadget screen with
- the text as a label for the progress bar, prepared to display 'n'
- steps. The 'progressaset()' routine gives the new window a close
- gadget. This routine returns 0 if successful and non-zero if
- unsuccessful. If you use 'progressaset()' to get a close gadget,
- then you must check the return code from 'progressupd()' to see if
- the user has actually pressed the close gadget.
- int progressupd(int i);
- -----------------------
- This draws the progress bar 'i' steps across. The value 'i' must
- not be larger than the total number of steps passed in
- 'progressset()'. It normally returns 0, but will return 1 if the
- progress bar was initiated with 'progressaset()' and the close
- button was pressed by the user.
-
- void progressend();
- -------------------
- This closes the progress window.
-
- void imes( char *string1, char *string2);
- -----------------------------------------
- This displays a message made up of two text strings. The text
- strings will be truncated if they are too large. If the second
- string is a null pointer, the default text "-Click Here to
- Continue-" will be displayed on the second line.
-
- void endvbars();
- ----------------
- This should be called when no more progress bars or messages are
- going to be displayed. You cannot use any of the routines provided
- once you have called this routine!
-
-
- The calling sequence is as follows:
-
-
- /---- beginvbars( struct Screen *IMscr );
- |
- All progress and | may /-- progressset(int n,char *text);
- message calls | be | progressupd(int i); /* i= 0 to n */
- must be between | repeated \-- progressend();
- 'beginvbars()' |
- and | anytime [-- imes( char *string1, char *string2);
- 'endvbars()' |
- \---- endvbars();
-
- See the example P.I. module NEGATIVE.c for actual source code that
- uses the VBAR calls in the proper manner.
-