[xgap] 2.3 How does it work?

[Up] [Previous] [Next] [Index]

# 2.3 How does it work?

XGAP consists of a C program `xgap` (in the following `xgap` in typewriter style refers to this C part) separate from GAP, and of some libraries written in the GAP language. `xgap` is started by the user and launches a GAP job in the background. It then talks to this GAP job. Especially it displays all the output which comes from GAP in the communication window and feeds everything the user types in this window into the GAP job.

But there is also some communication with the GAP job about the graphics that should be displayed. Because GAP has no concept of putting graphics on the screen, this part is done by `xgap`. Therefore there is a protocol between the GAP part of XGAP running in the GAP session and `xgap` which is embedded in the input/output stream. The user does not notice this. `xgap` stores all windows and graphic objects and does all the work necessary for displaying windows and managing user communication and so on.

The GAP part of XGAP also stores all graphical information, but in form of GAP objects. The user can inspect all these structures and use them in own programs. Changes in these structures are transmitted through the communications protocol to `xgap` and are eventually displayed on the screen. User actions like mouse clicks or keyboard events are caught by `xgap` and transmitted to the GAP job via function calls that are ``typed in'' as if the user had typed them. So the library can work on them and change the GAP objects accordingly.

Technically, XGAP is a share package and one of the first commands that is executed automatically within the GAP session is a `RequirePackage("xgap")` call. This reads in the extra XGAP libraries. They are found in the `pkg/xgap/lib` subdirectory, normally in the main GAP directory. The files contain the following:

`window.g`
  basic definitions for the communications protocol

`sheet.g[di]`
  graphic sheets and their operations

`color.g[di]`
  color information

`font.g[di]`
  text font information

`menu.g[di]`
  menus, dialogs, popups, and user communication

`gobject.g[di]`
  low level graphic objects and their operations

`poset.g[di]`
  graphic graphs and graphic posets

`ilatgrp.g[di]`
  graphic subgroup lattices

`meataxe.g[di]`
  support to display submodule lattices calculated within the C MeatAxe

The user normally does not need to know this or the details of it. However, it is important to understand that the program `xgap` is highly machine or at least operating system dependent. There is no generic way to access graphics across different platforms up to now. XGAP should run on all variants of Unix with the X Window System Version 11 Release 5 or higher. As of now XGAP does not run on Microsoft Windows or MacOS. It is also definitely not easily ported there, because some important features that are used within XGAP are missing there (such as pseudo terminals). There are currently no plans underways to do work in this direction. However, portations are very welcome! If you would like to put some work into this, please contact Max Neunhöffer (email: `max.neunhoeffer@math.rwth-aachen.de`).

[Up] [Previous] [Next] [Index]