


GEMBIND

A GEM binding for Turbo Pascal


(c) Jan Willamowius, 1993
    Rnckertstr. 27
    22089 Hamburg
    Germany
    Tel. 040 / 209 81 888


Translated to English
6/21/99 Kyle Davis
7/05/99 Thomas Huth


Introduction
------------

	Gembind is a library to write GEM programs with Turbo Pascal. It is fully compatible with the library of the ST Pascal 2.0 on the Atari ST. The only difference is that the Pascal dialects must be adapted. If you want to compile exactly the same programs on PC-GEM and Atari-GEM, you can use Pure-Pascal on the Atari (Pure-Pascal is quite compatible to Turbo-Pascal).

To use the GEM library in Turbo Pascal programs, include it like this:

USES GEMBIND;

Further Include files (e.g. like in ST Pascal) are not necessary.

	When using Turbo Pascal, there are some special cases you have to be aware of; i.e. GEM programs cannot be compiled to memory, they must be compiled to harddisk. They can not be started by Turbo Pascal, because DOS programs switch off the GEM and so, a DOS program can not start a GEM program.

	To reserve enough memory for GEM to work (for example, GEM needs free memory for the fileselector, see Get_In_File), you have to tell Turbo Pascal with the directive (*$M ... *) that it must not occupy all memory.

	Before a GEM program can be started, one must rename the program from .EXE to .APP, or you must register that program in the Desktop Menu as a GEM program. If not GEM recognizes it as a normal DOS program and does not run it as a GEM app. (one should not forget a storing of the adjustment in the Desktop!)  



Graphic functions
-----------------

Routine               Effect

Draw_Mode             Determine write/paint mode (overwrite, transparency etc..)
Line_Color            Select color for Lines
Paint_Color           Determine color for filled areas
Paint_Style           Determine pattern for filles areas
Line_Endstyle         Determine type of the Line end (round, angularly, arrow)
Line_Style            Line pattern (going through, interrupted etc.)
Paint_Rect            draw filled rectangle
Frame_Rect            draw the frame of a rectangle
Paint_Round_Rect      draw filled rectangle with round corners
Frame_Round_Rect      Draw frame of a rectangle with round corners
Paint_Oval            draw filled oval
Frame_Oval            draw the frame of a ellipse
Paint_Arc             draw filled arc 
Frame_Arc             draw the frame of an arc
Pline                 draw polyline
Plot                  draws a point
Clear_Screen          Clear the screen
Line_Width            determines the lines width 
Paint_Outline         determine whether filled areas have a frame or not
Set_Color             Determine paint color
Set_Clip              Limit graphics-area to a certain rectangle
Line_To               Draw a line from the indicated point
Move_To               sets the Turtle on a certain point
TLine                 draws a line in Turtle-graphic mode

Text_Heigth           Determine text height
Text_Rotation         Determine rotation angle of the text (in 90 degree steps)
Text_Style            Determine text-based attribute
Draw_String           draw a text
Justified_Tex         draw a justified text
String_Width          Calculate text width
Text_Point            Determine text height (in pixels)
Text_Alignment        Determine adjustment of the writing
Text_Color            sets the color of the writing
Alpha_Text            Print text on an alpha-numeric device

Growbox               draw growing, animated rectangles (only in GEM 1.0!)
Shrinkbox             draw shrinking, animated rectangles (only in GEM 1.0!)
Xgrf_2Box             draw animated rectangles
Xgrf_Stepcalc         Calculate coordinates for animated rectangle



Mouse-control
-------------

Routine               Effect

Init_Mouse            Starts mouse control in the program
Show_Mouse            Make mouse pointer visible
Hide_Mouse            Hide mouse pointer
Set_Mouse             give the mouse pointer another form
Begin_Mouse           ignore all mouse actions (especially in <Menus)
End_Mouse             Allow mouse actions again
Set_MForm             set user-defined mouse form
Mouse_Position        set mouse position



Window-administration
---------------------

Routine               Effect

New_Window            Create data structure for a new window
Open_Window           open a window on the screen
Close_Window          Close window on the screen
Delete_Window         Remove data structure of the window from the memory
Set_WSize             set window size
Set_Winfo             Set text of the information line of the window
Wind_Get              delivers different information about a window
Wind_Set              change the different parts of a window (for example the slider)
Border_Rect           Query frame sizeof the window
Work_Rect             Query working area size of the window	
Front_Window          Make window to the uppermost
Set_WName             Set headline of the window
Set_Window            the indicated window activates
Find_Window           Find window at the given coordinates
Front_Window          find frontmost window
Get_Window            question active window
Bring_To_Front        Bring window forwards

First_Rect            get first rectangle in which the program is allowed to draw
Next_Rect             get the next rectangle of that rectangle list
Rect_Intersect        get intersection rectangle of two other rectangles


Event functions
---------------

Routine               Effect

Get_Event             Wait for GEM events
Get_Button            Wait only for mouse click events
Get_Keyboard          Wait only for keyboard events
Get_Message           Wait only for message events
Get_Mouse             Wait only for mouse movement events
Get_Timer             Wait only for timer events



Dialog functions
----------------

Routine               Effect

Center_Dialog         Center dialogue on the screen
Form_Dial             Reserve and releasing of the screen
Show_Dialog           Draw dialogue on the screen
Objc_Draw             draw a single object
Do_Dialog             Shows dialogue and allow user interaction
Redo_Dialog           allow user-Interaktion again
End_Dialog            Remove dialogue of the screen
Get_DEdit             get edited text from the dialog
Obj_SetState          Set status of a dialogue-object (for example selectation)
Obj_State             Question status of an object
D_Color               set color of a dialogue object
Form_Do               Draw object ( ?? - I thought, this function is used to execute the dialog? - Thomas)
New_Dialog            construct new dialogue
Delete_Dialog         delete generated dialogue
Add_DItem             Add an object
Set_DText             Write text into an object
Set_DEdit             Write editable text into an object
Get_DEdit             Get editable text
Obj_Add               Add an object (low-level)
Obj_Find              Find object under coordinate
Obj_Flags             Question flags of an object
Obj_Offset            Question interval of an object to its parent
Obj_Redraw            redraw only one object
Obj_SetFlags          set the flags of an object
Obj_Size              Question size of an object



Various
-------

Routine               Effect

Load_Fonts            Load Fonts
Ex_Load_Fonts         enhanced Load_Fonts
Unload_Fonts          Remove fonts
Font_Name             Question font name
Font_Info             Question font information
Set_Font              Select font

Open_Workstation      Open a workstation (for example the screen)
Clear_Workstation     Reset workstation
Update_Workstation    Flush buffered commands (e.g. start printing on a printer)
Close_Workstation     Close workstation
Form_Advance          page feed

Split_Addr            Divide Pointer in 2 integer



Literature
----------
(untranslated)

  *   Data Becker Fuehrer Schneider PC, Data Becker, 1986
  *   Jankowski, Reschke, Rabich, ATARI ST Probibuch, Sybex, 1988
  *   GEM Programmers Toolkit, Digital Research, 1985
  *   Wollschl,ger, Atari ST Programmierpraxis ST Pascal Plus,
      Markt & Technik, 1987
  *   Middel, Das Betriebssystem des Atari ST, c't 2/1987 Seite 126ff
  *   Wollschl,ger, Multitasking und Desk Accessories, MC 3/1987 Seite 66ff




Differences between GEMBIND and PASGEM
--------------------------------------

- current screen resolution is avaiable in the variables GemmResX and GemResY

- New_Dialog and New_Menu ignore the N_Items-parameter and produce always an object tree with Max_Tree objects.  Because the place saving would be small, the additional effort wasn't it worth.

- Set_DEdit can repeatedly be called

- Do_dialogue uses Begin_Update and End_Update

- Some (?Unterbereichs?-) types were changed to integer (Color_Reg, Draw_fashions, Line_Types etc.)

- The type "Object" is named "GEM_Object", because "Object" is a reserved word since Turbo Pascal 5.5

- Init_Mouse does _not_ reset the interlocking-counter (whether and how PASGEM this does is not entirely clear to me)

- some minor changes on the constants and type definitions and some additions (especially to the GEM/3)

- Like in PASGEM the coordinate-offset is only queried in the call of Set_Window.  If the position of the window changes, Set_wind musst be called again.

- missing functions: 	
	- Get_Ex_Out_File (exists only in the GEM of the Atari) 
	- Open_Port and Close_Port (they also didn't work in PASGEM; use the ..._Workstation routines instead)

- additional functions: 
	- Xgrf_Stepcalc
	- Xgrf_2Box
	- Slidebox
	- Form_Dial
	- Form_Do
	- Mouse_Position
	- Text_Point
	- Splitt_Addr
	- Obj_Add
	- Rsrc_Obfix
	- Open_Workstation
	- Close_Workstation
	- Clear_Workstation
	- Update_Workstation
	- Form_Advance
	- Alpha_Text
	- Load_Fonts
	- Ex_Load_Fonts
	- Unload_Fonts
	- Set_Font
	- Font_Name
	- Font_Info
	- Get_Message
	- Get_Button
	- Get_Mouse
	- Get_Keyboard
	- Get_Timer
	- TLine
	- Menu_Unregister
	- Menu_Click
	- String_Width



### EOF ###
