Dec 072017
 
INTR_LIB C toolkit - an interaction graphics library for MSDOS environment. This library provide basic windowing facilities, pop up and pull down menus, and support keyboard, mouse and joystick devices.
File INTRLIB1.ZIP from The Programmer’s Corner in
Category C Source Code
INTR_LIB C toolkit – an interaction graphics library for MSDOS environment. This library provide basic windowing facilities, pop up and pull down menus, and support keyboard, mouse and joystick devices.
File Name File Size Zip Size Zip Type
COMMENTS 252 184 deflated
CURSOR.C 10582 1938 deflated
EMS.C 4563 1090 deflated
INPUT.C 25598 5071 deflated
INTRTEST.C 21928 3742 deflated
INTR_BGI.C 37771 7583 deflated
INTR_DJG.CC 36934 7069 deflated
INTR_EMS.H 704 274 deflated
INTR_GEN.C 4616 1298 deflated
INTR_GR.C 37137 7415 deflated
INTR_GR.H 5181 1570 deflated
INTR_LIB.DOC 34151 9495 deflated
INTR_LIB.H 17854 4036 deflated
INTR_LIB.LST 6768 1705 deflated
INTR_LOC.H 5374 1853 deflated
MAKEFILE.DJG 1640 681 deflated
MAKEFILE.TC 2463 993 deflated
MESSAGES.C 3307 897 deflated
MOUSEDRV.C 13819 3673 deflated
MOUSEDRV.H 1555 667 deflated
PD_MENUS.C 9292 2046 deflated
PU_MENUS.C 14879 3487 deflated
PU_QUERY.C 27312 5348 deflated
SAVEIMAG.C 13354 2733 deflated
SLCT_CLR.C 7426 1967 deflated
SOURCES.GET 1747 778 deflated
TEXTWNDW.C 13837 2881 deflated
WINDOW.C 67383 9995 deflated

Download File INTRLIB1.ZIP Here

Contents of the INTR_LIB.DOC file


INTR_LIB 1.0
------------


BECAUSE INTR_LIB AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT
ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT
PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I
GERSHON ELBER PROVIDE INTR_LIB PROGRAM AND ITS SUPPORTING TOOLS "AS IS"
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH
YOU. SHOULD THE INTR_LIB PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
NECESSARY SERVICING, REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER,
BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES,
OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A
FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON
ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.

This file provide some information about the INTR_LIB tool - an interaction
graphics library for MSDOS environment. This library provide basic windowing
facilities, pop up and pull down menus, and support keyboard, mouse and
joystick devices.
This library can currently be compiled for MSDOS using Borland's BC++
compiler or DJGPP - the gcc port for 386 machines. Porting for other
environment is feasible by rewriting one file - see intr_bgi.c and intr_djg.c
for example.

Applications wishes to use the library should include intr_lib.h which
is the main interface. Under some conditions intr_gr.h may be needed as well.
This may be true mainly for low level drawing routines (lines, arcs, etc.).

Most functionality of this library is based on selection and abortion
operations. The SELECT is specified by the left mouse button, the space
bar, or button one of the joystick. The ABORT is specified by the right mouse
button, the Enter key, or button two of the joystick. Several other events
may occur and include middle mouse button event (two button mouse can
generate it by pressing both buttons simultanuously), cursor movement
keystroke or window refresh request. See IntrEventType in intr_lib.h

Screen pixel coordinates are rarely used in this library. The mouse
location is specified in this coordinate system but mapping routines are
provided to map it to window coordinates.
Drawing into windows is always done in window (not screen) coordinates.
Two equivalent coordinate systems are provided for each window. The first
uses the window pixel coordinate system where (0, 0) is the window (not
screen) corner, and (x, y) are specified in pixels for zero to window
pixel width and height. The second coordinate system provided for each
window is normalized. The user specifies the bounding box of the normalized
coordinate system, say from (-1.0, -1.0) to (1.0, 1.0) (see IntrWndwSetFBBox)
and these locations will be mapped to the entire screen. For the above
example (-1.0, -1.0) will match one corner of the window, (1.0, 1.0) the
other corner (diagonally) and (0.0, 0.0) will always be the window center.
Note that windows can have any aspect ratio, so aspect ratio correction
should be imbedded into this FBBox.

During a session this package is used, there may be a Selected Window
and a Drawing Window. A Selected window is a window with highlighted colors.
Default is to have no selected window. Drawing window is the window all
drawing command are going to. There are several routines to control both.

To isolate as much as possible the data structures from the application
windows are specified using an integer id, referred as WindowID in most
functions below.

Colors are specified in two levels, in this library. All the windowing
widget uses a four intensity level scheme (if enough colors are provided)
via IntrColorType and IntrIntensityType. Each color in IntrColorType has
four intensity levels 9See intr_lib.h). This is the way the window borders
are created, for example.
The regular (line, circle, etc.) drawing routines specified direct
color via the colors in the supporting package (BGI graphics.h interface for
BC++ with intr_gr.h, or DJGPP graphics.h with intr_gr.h). The colors are
specified via the GRSetColor command (see intr_gr.h).

This file barely document the intr_lib portion of this package. intr_gr.h
which is the low level drawing interface is not documented. Most routines
there follows Borland's BGI interface and so one may refer to their...

I am not even close to being happy with this documentation. Given my
time constraints i have, this is the maximum I can do. if you feel like
writing a better one, I will be very happy to hear from you. If you find
bugs and fixed them, I will be happy to hear that too. If you find a bug
and cannot fix it, drop me a message, but I provide no guarantee.

Gershon Elber

[email protected]

-----------------------------------------------------------------------------

General library control
-----------------------
void IntrInit(void);
Initialize the library. Should be invoked before any other function
in this library. This routine will also switch to graphics mode.

void IntrClose(void);
Close the library. No other function from this library should be
called after this routine. This routine switch back to text mode.

void IntrFatalError(char *Msg);
Mainly internal routine to close the library and print a fatal error
message.

int IntrPopUpActive(void);
Returns 0 iff no window is currently poped up. Otherwise returns
number of poped up windows.

Color allocation routines
-------------------------
int IntrAllocColor(IntrColorType Color, IntrIntensityType Intensity);
Mainly internal routine to allocate a color with specific intensity.
Returns the color index.

void IntrAllow256Colors(IntrBType Allow256Colors);
On devices that support 256 colors, the default behaviour is to
support and use only 16 colors (to be compatible with EGA/VGA 16
colors mode). If invoked with TRUE, then all 256 colors may be used
for more fine colors. This function has no affect under DJGPP which
always use 256 colors.

Window manipulation routines
----------------------------
int IntrWndwCreate(char *WindowName,
int FrameWidth,
IntrBBoxStruct *BBox,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrCursorShapeStruct *Cursor,
IntrPullDownMenuStruct *PDMenu,
IntrIntFunc RefreshFunc);
Create an instance of a window. This routine DOES NOT make the window
visible (See IntrWndwPop below). Specified are the window name,
its size bbox (of the drawable portion, not including the frame),
width of the window frame in pixels and its color, the window back
ground color, type of cursor to use under this window, optional
pull down menu for this window, and an optional refresh function.
The pull down menu may be created by IntrPullDownMenuCreate. NULL
means no pull down menu for this window.
The refresh function is a function that should redraw the window
should it be resized, poped up, etc. This routine should assume
that viewport is set at time of invocation and that the window is
all visible. The function gets one parameter which is the window id
(in case the same function is used to update several windows).
Most of these parameters may be get/set via specific functions
(see below).

void IntrWndwSetRoot(int RootWindowID);
Sets a window to be a root window. A root window cannot be poped up
and will always be below all other windows.

void IntrWndwSelect(int WindowID);
Make this window the selected window. The selected window frame
will drawn intensified. Generally there is only one selected window
unless all windows are selected (default behaviour). See also
IntrWndwSelectAll.

void IntrWndwSelectAll(IntrBType SelectAll);
If TRUE all windows are considered selected (default). If FALSE only
the one as set by IntrWndwSelect is selected.

void IntrWndwRedrawAll(void);
Redraw all windows. This routine will also invoke the refresh function
foreach window, if it has one.

void IntrWndwClear(int WindowID);
Clear the specified window to its background color. This routine
also make this window the drawing window.

int IntrWndwPick(void);
Picks a window by asking the user to click SELECT while the cursor
is on the to be picked window. Returned is the picked window id,
-1 if no window was picked (clicked on background), 0 if ABORT.

void IntrWndwPop(int WindowID, IntrBType DoRedraw, IntrBType DoClear);
Pops up the specified window. If DoRedraw then the redraw function
of this window (if it has one) is invoked. If DoClear then window
is only cleared. If the window was unvisible (a newly created or
hidden by IntrWndwHide) then it will become visible.

void IntrWndwPush(int WindowID, IntrBType DoRedraw);
Pushes down the specified window. If DoRedraw then the redraw function
of this window (if it has one) is invoked. If the window was unvisible
(a newly created or hidden by IntrWndwHide) then it will become visible.

IntrBType IntrWndwIsAllVisible(int WindowID);
A Boolean predicate that returns TRUE iff the entire window is
visible, i.e. not hidden by any other window.

void IntrWndwSetResizeBBox(IntrBBoxStruct *BBox);
Controls the maximum domain IntrWndwResize will allow a window to
be resized. This allows for example to control resizing of a window
in a certain region in the screen.

IntrBType IntrWndwMove(int WindowID, IntrBType Refresh);
Moves the specified window. If Refresh then the screen will be
refreshed to reflect the new location.

IntrBType IntrWndwResize(int WindowID, IntrBType Refresh);
Resize the specified window. If Refresh then the screen will be
refreshed to reflect the new location. See also IntrWndwSetResizeBBox
and IntrWndwFullSize.

void IntrWndwFullSize(int WindowID, IntrBType Refresh);
Resize the specified window to the maximum size allowed as specified
by IntrWndwSetResizeBBox. If Refresh then the screen will be refreshed
to reflect the new location.

void IntrWndwHide(int WindowID, IntrBType Refresh);
Make a window invisible. The window is not modified in any other way
and can be made visible any time after using IntrWndwPush/Pop.
If Refresh is TRUE then the screen is actually refreshed to reflect
on the hidden window.

void IntrWndwDelete(int WindowID, IntrBType Refresh);
Same as IntrWndwHide but this window is deleted and should be be
referenced any more.

int IntrWndwGetHeaderHeight(char *Header, int FrameWidth);
Mainly internal routine to compute the height of the window header
given the header string and the frame width.

IntrBBoxStruct *IntrWndwGetBBox(int WindowID);
Returns pointer to the specified window bbox size.

IntrFBBoxStruct *IntrWndwGetFBBox(int WindowID);
Returns pointer to the specified window bbox of normalized coordinates.

IntrColorType IntrWndwGetFrameColor(int WindowID);
Returns the specified window frame color.

IntrColorType IntrWndwGetBackGroundColor(int WindowID);
Returns the specified window background color.

IntrCursorShapeStruct *IntrWndwGetCursorShape(int WindowID);
Returns pointer to the specified window cursor shape.

IntrPullDownMenuStruct *IntrWndwGetPullDownMenu(int WindowID);
Returns pointer to the specified window pull down menu.

int IntrWndwGetZoomFactor(int WindowID);
Returns the specified window zoom factor.

IntrIntFunc IntrWndwGetRefreshFunc(int WindowID);
Returns pointer to the specified window refresh function.

void IntrWndwGetPanFactors(int WindowID, int *x, int *y);
Returns the specified window pan factor.

void IntrWndwSetName(int WindowID, char *Name);
Sets the specified window name.

void IntrWndwSetDrawHeader(int WindowID, IntrBType DrawHeader);
Sets the specified window draw header boolean flag. If TRUE window
header is drawn, if FALSE it is not.

void IntrWndwSetBBox(int WindowID, IntrBBoxStruct *BBox);
Sets the specified window BBox. This has the affect of resizing the
window although the screen has to be refreshed for this to be
visible (see IntrWndwRedrawAll).

void IntrWndwSetFBBox(int WindowID, IntrFBBoxStruct *FBBox);
Sets the specified window normalized coordinates.

void IntrWndwSetFrameColor(int WindowID, IntrColorType FrameColor);
Sets the specified window frame color.

void IntrWndwSetBackGroundColor(int WindowID, IntrColorType BackColor);
Sets the specified window back ground color.

IntrBType IntrWndwIsScrollBarEvent(int WindowID,
IntrBType *IsVertical,
IntrRType *Value);
Mainly internal routine to handle scroll bar event.

int IntrWndwScrollBarWidth(void);
Returns the width in pixels of the scroll bar.

void IntrWndwUpdateScrollBar(int WindowID,
IntrBType IsVertical,
IntrRType RelativePosition,
IntrRType DisplayedFraction);
Updates a vertical (IsVertical is TRUE) or an horizontal (FALSE)
scroll bar of the specified window by specifing the active window
visible fraction and relative position.

void IntrWndwSetScrlBar(int WindowID,
IntrBType IsVertical,
IntrScrlBarType ScrlBar,
IntrColorType ScrlBarColor);
Enable a vertical (IsVertical is TRUE) or an horizontal (FALSE)
scroll bar for the specified window. be default a window does
not have a scroll bar.

void IntrWndwSetCursorShape(int WindowID, IntrCursorShapeStruct *Cursor);
Sets the specified window Cursor shape.

void IntrWndwSetPullDownMenu(int WindowID, IntrPullDownMenuStruct *PDMenu);
Sets the specified window pull down menus.

void IntrWndwSetRefreshFunc(int WindowID, IntrIntFunc RefreshFunc);
Sets the specified window refresh function.

void IntrWndwUpdatePanning(int WindowID, int x, int y);
Relatively increment the panning of the specified window.

void IntrWndwSetPanning(int WindowID, int x, int y);
Sets the specified window panning factors.

void IntrWndwUpdateZoom(int WindowID, int Zoom);
Relatively increment the zoom factor of the specified window.

void IntrWndwSetZoom(int WindowID, int Zoom);
Sets the specified window zoom factors.

void IntrWndwSetStatus(int WindowID, char *StatusLeft, char *StatusRight,
IntrBType Refresh);
Updates the window header left and right status strings. A window
can display two strings at the left and right side of its header
(if the header is displayed obviously). If Refresh the screen is
refreshed to reflect this change.


Window drawing routines
-----------------------
void IntrWndwILine(int x1, int y1, int x2, int y2);
Draw a line in the drawing window using window pixel coordinates.

void IntrWndwRLine(IntrRType x1, IntrRType y1, IntrRType x2, IntrRType y2);
Draw a line in the drawing window using window normalized coordinates.

void IntrWndwIMoveTo(int x, int y);
Move to a new location in the drawing window using window pixel
coordinates.

void IntrWndwRMoveTo(IntrRType x, IntrRType y);
Move to a new location in the drawing window using window normalized
coordinates.

void IntrWndwILineTo(int x, int y);
Line to a new location in the drawing window using window pixel
coordinates.

void IntrWndwRLineTo(IntrRType x, IntrRType y);
Line to a new location in the drawing window using window normalized
coordinates.

void IntrWndwIMoveRel(int x, int y);
Move to a new location relative to current location in the drawing
window using window pixel coordinates.

void IntrWndwRMoveRel(IntrRType x, IntrRType y);
Move to a new location relative to current one in the drawing window
using window normalizedcoordinates.

void IntrWndwILineRel(int x, int y);
Line to a new location relative to current one in the drawing window
using window pixel coordinates.

void IntrWndwRLineRel(IntrRType x, IntrRType y);
Line to a new location relative to current one in the drawing window
using window normalizedcoordinates.

void IntrWndwIPoly(int n, int *Points, int Fill);
Draw a polyline in the drawing window using window pixel coordinates.
The polyline is specified by its length n and a vector of 2n integers
as x1, y1, x2, y2, ... xn, yn - Points. If Fill is TRUE the polyline
is assumed to be simple closed polygons which is filled.

void IntrWndwIBar(int x1, int y1, int x2, int y2);
Draw a filled rectangle in the drawing window using window pixel
coordinates.

void IntrWndwRBar(IntrRType x1,
IntrRType y1,
IntrRType x2,
IntrRType y2);
Draw a filled rectangle in the drawing window using window normalized
coordinates.

void IntrWndwICircle(int x, int y, int r);
Draw a circle in the drawing window using window pixel coordinates.
Circle center is at (x, y) and radius r.

void IntrWndwRCircle(IntrRType x, IntrRType y, IntrRType r);
Draw a circle in the drawing window using window normalized coordinates.
Circle center is at (x, y) and radius r.

void IntrWndwIArc(int x, int y, int StAngle, int EndAngle, int r);
Draw an arc in the drawing window using window pixel coordinates.
The arc center is at (x, y) with starting and ending angles and of
radius r.

void IntrWndwRArc(IntrRType x,
IntrRType y,
int StAngle,
int EndAngle,
IntrRType r);
Draw an arc in the drawing window using window normalized coordinates.
The arc center is at (x, y) with starting and ending angles and of
radius r.

void IntrWndwIText(int x, int y, char *s);
Draw the specified text string in the drawing window at the specified
location in pixel coordinates. See also GRSetTextJustify.

void IntrWndwRText(IntrRType x, IntrRType y, char *s);
Draw the specified text string in the drawing window at the specified
location in normalized coordinates. See also GRSetTextJustify.

Text handling in graphic windows
--------------------------------
void IntrTextInitWindow(int WindowID,
IntrBType ReadBottomLine,
IntrColorType TextColor,
IntrColorType BottomLineColor,
IntrScrlBarType HScrlBar,
IntrScrlBarType VScrlBar,
int NumOfLines,
int LineLen);
Initialize a window to handle text. This routine makr the window
as text window and initialize the necessary data structure for such
support. If ReadBottomLine is TRUE then it is assumed this window
will be used to read text interactively via IntrGetLineWindow.
Text colors are specified as well as possible scroll bars for the
window. Number of lines to save (which can be viewed by clicking
on the scroll bar and therefore can be more than can be displayed
at once) and there maximal length is also specified.

void IntrTextSetSmoothScroll(IntrBType SmoothScrolling);
By default text is scrolled by clearning the entire screen and
drawing the new text. If SmoothScrolling is TRUE smooth scrolling
(but slower one) will take affect.

void IntrTextWndwRefresh(int WindowID);
A refresh function for a text window. May be used in IntrWndwCreate.

void IntrPrintf(int WindowID, IntrBType UpdateWindow, char *CtrlStr, ...);
A printf equivalent routine to printf directly to a text window.

void IntrGetLineWindow(int WindowID, char *Buffer, int BufferLen);
A routine to get a single line into Buffer with maximal length
BufferLen in the specified window bottom line. Full line editing
is provided via left/right arrow keys, backspace, home/end and esc
to clear the line. The up/down arrow keys provide history buffer of
10 last line entries.

Cursor control routines
-----------------------
void IntrUseMouseDriverCursor(IntrBType UseMouseCursor);
If TRUE attempt is made to use the mouse driver internal mouse support.
By default only intr_lib cursors are used.

void IntrPushCursorType(void);
A simple stack mechanism to preserve the current cursor type.
Can be restored via IntrPopCursorType.

void IntrPopCursorType(void);
Restore the last pushed cursor -see IntrPushCursorType.

IntrCursorShapeStruct *IntrGetCursorType(void);
Returns current cursor type.

void IntrSetCursorType(IntrCursorShapeStruct *Cursor);
Set a new cursor type. See IntrCursorType for different cursor types.

void IntrSetCursorType2(IntrCursorType CursorType,
void (* CursorRoutine)(int, int),
int Width, int Height, int LastX, int LastY,
IntrBType LastHV);
Mainly internal routine to draw cursor shapes.

void IntrShowCursor(int x, int y);
Display the currently selected cursor at the screen pixel specified
coordinate.

void IntrReposCursor(int x, int y);
Move and redraw a cursor at a new location.

void IntrUnShowCursor(void);
Display the currently selected cursor at the screen pixel specified
coordinate.

Simple messages mechanism
-------------------------
void IntrDrawMessage(char *Str, IntrColorType ForeColor,
IntrColorType BackColor);
A simple widget to temporary display a message with the specified
colors. Message is displayed at the screen top left corder.
Message can be erase on IntrEraseMessage below.

void IntrEraseMessage(void);
See IntrDrawmessage above.

Input event handling routines
-----------------------------
int IntrGetch(void);
get one character from keyboard or wait for one if none was pressed
yet. If an extended key was pressed (such as a PF key) it will
be returned as 0 followed by the extended code in the next call.

int IntrKbHit(void);
Returns non zero if keyboard buffer is not zero. Never wait for
input.

void IntrSetIdleFunction(IntrVoidFunc IdleFunction);
When waiting for events, this routine may be invoke to do something
useful. This routine should complete its task in a fraction of a
second to provide a reasonable response time in event handling.

void IntrSetAtKeyboard(IntrBType IsATKeyboard);
If the systme is an AT type (TRUE), a more advanced keyboard is
assumed which support more codes such as F11 and F12. On DJGPP
this routine is ignored.

void IntrSetMouseSensitivity(int Sensitivity);
Provide control on mouse seinsitivity...

IntrBType IntrRegisterKeyStroke(int KeyStroke, IntrIntFunc ActionFunc);
Provide an async. method to invoke a function when the specified
keystroke is detected. KeyStroke is a regular ascii code for regular
keystrokes or +256 if extended code. ActionFunction can for example
be a function to pop up a menu. Up to 50 keystrokes can be registered
Not way is currently provided to unregister a key.

void IntrSetInputDevice(int Devices);
Sets which input devices should be handled. Currently the keyboard,
mouse, and joystick are the supported devices. See IntrInputDeviceType
in intr_lib.h. The different device types are ORed together to
define the set of input devices to support.

void IntrSetHandleInternalEvents(IntrBType HandleEvents,
IntrBType PropagateEvents);
Control automatic handling of internal events (such as SELECT event
on a scroll bar which generally means update the window with scroll
bar in new specifid location). If HandleEvents (TRUE by default)
then this will be done automatically. If PropagateEvents (TRUE by
default) then the events will also be propagated to the application
program. Make PropagateEvents FALSE will total hide this automatic
process from an application program.

void IntrInputFlush(void);
Make sure all input devices queues are empty.

IntrEventType IntrGetEventWaitSA(int *x, int *y);
Wait until either SELECT, ABORT, or MIDDLE_BUTTON event is
generated. x and y should, in general, be ignored.

IntrEventType IntrGetEventWait(int *x, int *y);
Wait until any event is generated. x and y will hold the current
cursor position in screen pixel coordinates.

IntrEventType IntrGetEventNoWait(int *x, int *y);
Same as IntrGetEventWait but will return INTR_EVNT_NONE if no event
is pending on one of the input devices.

IntrEventType IntrGetTextEventWait(void);
Same as IntrGetEventWait but no cursor is displayed.

IntrEventType IntrGetTextEventNoWait(void);
Same as IntrGetEventNoWait but no cursor is displayed.

void IntrPushKbdEvent(int KbdEvent);
One level queue to insert keyboard events to IntrGetEvent{No}Wait
routines.

IntrBType IntrMapEventToWindow(int WindowID, int x, int y, int *Wx, int *Wy);
Routine to verify if the cursor is on (screen pixel coord (x, y)) the
specified window (WindowID). If on window, TRUE is returned and Wx, Wy
are set to this window, window pixel coordinates of the clocation.
FALSE is return if cursor is not on window.

IntrBType IntrMapEventToRWindow(int WindowID, int x, int y,
IntrRType *Wx, IntrRType *Wy);
Same as IntrMapEventToWindow but returned screen coordinates are in
normalized coordinates instead.

Routines to control images back saving
--------------------------------------
void IntrSetAsyncEventMode(IntrBType AsyncMode);
If AsyncMode is TRUE, All events will be handled all time async.. This
make be quite confusing when several windows are poped up
simulanouosly. Up to 20 pop up windows are allowed. Setting it to
FALSE (default) will allow only one poped up item at the same time.

void IntrSetSaveBackGround(IntrBType SaveBackGround);
Usually, when a window is poped up, the raster display below it is
automatically being saved (default behaviour). By setting
SaveBackGround to FALSE this would not occur, but the application
will have to refresh the screen.

void IntrSetSaveBackMethod(IntrSaveMemType SaveBackMethod);
Allow backsaving (see IntrSetSaveBackGround) to regular memory, ems
memory, or xms memory (no support yet), or (ram) disk. See
IntrSaveMemType in intr_lib.h. Note that for the DJGPP version only
regular linear memory (which you have up to 200M of) is used and this
function has no affect.

void IntrSetSaveBackPath(char *Path);
If IntrSetSaveBackMethod saves to disk, this routine specifies the
full path to the saving directory.

Query Interaction routines
--------------------------
void IntrQueryContinue(char *Question,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor,
int FrameWidth,
IntrCursorShapeStruct *Cursor,
int WindowID);
A widget to allow posting a message (Question) to the user. The
user will have to SELECT the "Continue" button for this function to
return. If WindowID is a valid window, attempt will be made to
center the query in that window. Alternatively WindowID can be one
of INTR_WNDW_PLACE_LEFT/RIGHT/CENTER (see intr_lib.h) in which
the query will be centered in screen Y but placed accordingly in
screen X.

void IntrQueryContinue2(char *Question,
void (* ExecFunc)(void),
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
int FrameWidth,
IntrCursorShapeStruct *Cursor,
int WindowID);
Same as IntrQueryContinue, but invoke ExecFunc to wait for the
SELECT event. This allows the application to do something useful
at the meantime.

IntrBType IntrQueryYesNo(char *Question,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor,
int FrameWidth,
IntrCursorShapeStruct *Cursor,
int WindowID);
Same as IntrQueryContinue but instead of the "Continue" button,
two "Yes" and "No" button are displayed. TRUE is returned if the "Yes"
button is SELECTED, FALSE if the "No.

char *IntrQueryLine(char *Question,
char *Buffer,
int BufferSize,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
int FrameWidth,
int WindowID);
Same as IntrQueryContinue but instead of the "Continue" button,
a full line editing capability is provided as follow:
Left/Right arrows - moves right and left in the line.
Up/Down arrows - circle a history buffer of last 10 lines.
Home/End to move to beginning/End of string respectively.
ESC - totally clears the current edited line.
Delete - deletes current character.
Insert - toggle Insert/Overwrite mode.
Backspace - delete character before current one.
Return to accept current line and abort editing.
The line is saved into Buffer which is assumed to be no longer then
BufferSize. Buffer address is returned by this function.

int IntrQueryList(char *Header,
char **StrEntries,
int SizeOfEntry,
int NumOfEntries,
int NumOfDisplayedEntries,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor,
int FrameWidth,
IntrCursorShapeStruct *Cursor,
int WindowID);
Same as IntrQueryContinue but instead of the "Continue" button,
a whole list (of any length) of items is displayed so one item
can be picked. List header is specified in Header. The items
may be specified in two ways:
* As an array of string pointers StrEntries, each points to a
string - an item. In this case SizeOfEntry = 0.
* A linear long string StrEntries (which is in fact of type
(char *)) where the i'th item is at
((char *) StrEntries)[i * SizeOfEntry]
NumOfEntries specifies how many items exists in the list. If they
cannot be all displayed simultanouosly, a scroll bar may be used
to select the ones not currently displayed.
Returned is the index of the list item picked.

Pop Up Menu Interaction routines
--------------------------------
IntrPopUpMenuStruct *IntrPopUpMenuCreate(char *Header,
char **StrEntries,
int SizeOfEntry,
int NumOfEntries,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor,
int FrameWidth,
IntrCursorShapeStruct *Cursor);
Constructs a pop up menu. See IntrQueryList for Header, StrEntries,
SizeOfEntry, and NumOfEntries.

void IntrPopUpMenuDelete(IntrPopUpMenuStruct *Menu);
Delete all memory used by the specified pop up menu. This menu
should not be referenced any more after this function is called.

void IntrPopUpSetEntry(IntrPopUpMenuStruct *PUMenu, char *Entry, int Index);
Allows a pop up menu entry Index to be changed to Entry. Only menus
constructed with SizeOfEntry == 0 (see IntrQueryList) can be modified.

void IntrPopUpSetHeader(IntrPopUpMenuStruct *PUMenu, char *Header);
Sets a new header Header for the given pop up menu PUMenu.

void IntrPopUpSetFrameWidth(IntrPopUpMenuStruct *PUMenu, int FrameWidth);
Sets a new frame width for the given pop up menu PUMenu.

void IntrPopUpSetColors(IntrPopUpMenuStruct *PUMenu,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor);
Sets a new set of colors for the given pop up menu PUMenu.

int IntrPopUpMenu(IntrPopUpMenuStruct *PUMenu,
int WindowID);
Actually pops up a menu and make it visible. See IntrQueryContinue
for WindowID meaning. Returns TRUE if an item was SELECTed from
menu, FALSE if ABORTed. Note that if an item was selected the selected
index will be saved in the menu SelectedIndex slot.

Pull Down Menu Interaction routines.
------------------------------------
IntrPullDownMenuStruct *IntrPullDownMenuCreate(char **StrEntries,
int SizeOfEntry,
int NumOfEntries,
IntrIntFunc *ActionFuncs,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor,
int FrameWidth);
Constructs a pull down menu. See IntrQueryList for Header, StrEntries,
SizeOfEntry, and NumOfEntries. Pull down menus are closely associated
will regular windows - see IntrWndwCreate. The ActionFuncs array
specifies which function to invoke when a specified button in the
menu is activated. Specify NULL to deactivate an entry.

void IntrPullDownMenuDelete(IntrPullDownMenuStruct *Menu);
Delete all memory used by the specified pull down menu. This menu
should not be referenced any more after this function is called.

void IntrPullDownSetEntry(IntrPullDownMenuStruct *PDMenu, char *Entry,
int Index);
Allows a pull down menu entry string Index to be changed to Entry.
Only menus constructed with SizeOfEntry == 0 (see IntrQueryList) can
be modified.

void IntrPullDownSetAction(IntrPullDownMenuStruct *PDMenu,
IntrIntFunc ActionFunc, int Index);
Allows a pull down menu entry action function Index to be changed
to ActionFunc.

void IntrPullDownSetFrameWidth(IntrPullDownMenuStruct *PDMenu, int FrameWidth);
Sets a new frame width for the given pull down menu PUMenu.

void IntrPullDownSetColors(IntrPullDownMenuStruct *PDMenu,
IntrColorType FrameColor,
IntrColorType BackColor,
IntrColorType ForeColor,
IntrColorType XorColor);
Sets a new set of colors for the given pull down menu PUMenu.


 December 7, 2017  Add comments

Leave a Reply