

	PI: Portable Interfaces for Prolog applications
	===============================================

1) What is to PI?
  ---------------

PI is an interface between Prolog applications and XWindows 
that aims to be independent from the Prolog engine.

It is divided in two libraries:

	* Edipo - the lower level interface to the Xlib functions, 
		allows you to:
			create and manage windows
			use graphical primitives
			receive events

	* Ytoolkit - the higher level user interface toolkit
		allows you to:
			create and manage graphical objects
			define new classes of objects
			handle user interaction

2) Distribution of PI
  -------------------

In this distribution you will find the following directories

	dir.		contents
	----------------------------------------------------------------
	edipo		interface to Xlib Prolog and C code
	ytoolkit	toolkit Prolog sources
	doc		manual in latexinfo format (you must have latex)
	demo		a few demo that show how this works 

and the files 

	dir.		contents
	----------------------------------------------------------------
	README		this file
	Makefile	PI installation makefile


3) Making PI
  -----------

Edit the file Makefile and set the following variables 

	vars.		values					default
	----------------------------------------------------------------
	QUINTUS		Quintus prolog command in your site	prolog
	SICSTUS		SICStus prolog command in your site	sicstus
	YAP		YAP prolog command in your site		yap
	CC		your favorite c compiler		cc

	INCPATH		where to look for load include files	
	OCFLAGS		other CFLAGS and			-O	
			-DOLD=1	for SICStus version less than 2.1#6
			-pic for Quintus in SunOS


	type:           to:
	----------------------------------------------------------------
        make quintus    make PI for Quintus Prolog
        make sicstus    make PI for SICStus Prolog
        make both       make PI both for Quintus and SICStus
        make yap        make PI for YAP Prolog

        make resources  modify Prolog compiler's resource files
        make clean

        make doc        make documentation


4) Using PI
  ---------
You should use the initialization file pi_paths.pl that is produced by
"make" every time you want Edipo or the Ytoolkit.

	$  sicstus -l ~/pi/pi_paths.pl
	
	$  prolog -l ~/pi/pi_paths.pl

Remember that you can can also execute "make resources" to concatenate this file to your prolog's standard resource file.

Chech the directory 'demos' for some examples of programs that use PI.

5) Documentation about PI
  -----------------------

In the distribution tape you should find the in the directory "doc"
some documentation files. Just type "make" in this directory (or in the PI home directory) to produce an hard copy of the manual.

You can also process the file pi.latexinfo in emacs, using the command
"latexinfo-format-buffer" to make a on-line manual. 

6) Problems with PI
  -----------------

If you have problems please contact Jose' Paulo Leal at zp@ncc.up.pt

