Agar Logo

Agar 1.7 Manual

(Printable Version)


Agar is a cross-platform GUI system and framework. It provides a programming platform and a standard toolkit of widgets from which graphical applications can be built.


The ag_core library is Agar's non-graphical platform and utility library. It implements the base object system, events / virtual functions and timers. It provides cross-platform interfaces to OS services such as filesystems, kernel-based events, timers and threads. To use this library alone (without GUI), link against agar-core-config --libs.

AG_Config(3) Manage Agar configuration settings.
AG_Core(3) Core Agar library initialization.
AG_DataSource(3) Data sources and serialization.
AG_Db(3) Generic database access methods.
AG_DSO(3) Dynamic linker interface.
AG_Error(3) Error handling and error-checking memory allocation.
AG_Event(3) Event handlers / virtual functions.
AG_EventLoop(3) Low-level event loop. Event sources and sinks.
AG_Execute(3) File execution interface.
AG_File(3) File access routines.
AG_Limits(3) Limit constants.
AG_Object(3) The Agar object system.
AG_String(3) C string specific functions.
AG_TextElement(3) Multilanguage dynamic text buffer.
AG_Threads(3) Threads interface.
AG_Timer(3) The Agar timer facility.
AG_Time(3) Monotonically-increasing time sources.
AG_User(3) User account information access.
AG_Variable(3) Agar object variables.
AG_Version(3) Data file versioning.


The ag_gui library includes the base Agar GUI system and its standard widget toolkit. To use it, link against agar-config --libs.
AG_AlphaFn(3) Alpha blending functions.
AG_Color(3) Color structure.
AG_Cursor(3) Cursor configuration.
AG_Driver(3) Driver (backend) interface.
AG_DriverSw(3) Driver interface for single-window drivers.
AG_DriverMw(3) Driver interface for multi-window drivers.
AG_GlobalKeys(3) Application-wide keyboard shortcuts.
AG_GL(3) OpenGL-specific functions.
AG_GuiDebugger(3) GUI debugging tool.
AG_InitGraphics(3) Agar GUI initialization.
AG_Keyboard(3) Interface to keyboard status.
AG_KeySym(3) Keyboard key definitions.
AG_KeyMod(3) Modifier keys definitions.
AG_MouseButton(3) Mouse button definitions.
AG_StyleSheet(3) Agar's version of cascading style sheets.
AG_Surface(3) Graphics surfaces.
AG_Text(3) Typography; interface to the font engine.
AG_Units(3) Conversion between different unit systems.
AG_Widget(3) The base class for Agar widgets (and windows).
AG_WidgetPrimitives(3) Rendering primitives for GUI elements.
AG_Window(3) The base container for Agar widgets.


Standard widgets in in ag_gui (unless built with "--disable-widgets").
AG_Box(3) Horizontal/vertical widget container.
AG_Button(3) Push-button widget.
AG_Checkbox(3) Checkbox widget.
AG_Combo(3) Canned text input/drop-down menu widget.
AG_Console(3) Scrollable text console widget.
AG_DirDlg(3) Directory selection widget.
AG_Editable(3) The Agar text editor (plain editable field).
AG_FileDlg(3) File selection widget.
AG_Fixed(3) Container for fixed position/geometry widgets.
AG_FontSelector(3) Font selection widget.
AG_GLView(3) Low-level OpenGL context widget.
AG_Graph(3) Graph display widget.
AG_FixedPlotter(3) Plotter for integral values.
AG_HSVPal(3) Hue/saturation/value color picker widget.
AG_Icon(3) Drag-and-droppable object that can be inserted into AG_Socket(3) widgets.
AG_Label(3) Display a string of text (static or polled).
AG_MPane(3) Standard single, dual, triple and quad paned view.
AG_Menu(3) Menu widget.
AG_Notebook(3) Notebook widget.
AG_Numerical(3) Spinbutton widget (for integers or floats).
AG_Pane(3) Dual paned view.
AG_Pixmap(3) Displays arbitrary surfaces.
AG_ProgressBar(3) Progress bar widget.
AG_Radio(3) Simple radio group widget (integer).
AG_Scrollbar(3) Scrollbar (integer or floating-point).
AG_Scrollview(3) Scrollable view.
AG_Separator(3) Cosmetic separator widget.
AG_Slider(3) Slider control (integer or floating-point).
AG_Socket(3) Placeholder for drag-and-droppable AG_Icon(3).
AG_Statusbar(3) Specialized statusbar widget.
AG_Table(3) Table display widget.
AG_Treetbl(3) Tree-based table display widget.
AG_Textbox(3) The Agar text editor (an AG_Editable in a box).
AG_Tlist(3) Linearized tree / list box widget.
AG_Toolbar(3) Specialized button container for toolbars.
AG_UCombo(3) Single-button variant of AG_Combo(3).


The ag_math library is a general-purpose math library which extends Agar with new widgets and support for linear algebra / geometry types. To use this library, link against agar-math-config --libs.
M_Matrix(3) Matrix operations. Provides optimized methods for sparse matrices (common in scientific applications) as well as 4x4 matrices (common in computer graphics).
M_Circle(3) Circles in R2 and R3.
M_Color(3) Mapping between different color spaces.
M_Complex(3) Complex-number arithmetic.
M_Coordinates(3) Mapping between different coordinate systems.
M_Sort(3) Sort algorithms (qsort, heapsort, mergesort, radixsort)
M_IntVector(3) Vector operations for vectors with integer elements.
M_String(3) Math-specific extensions to the AG_Printf(3) engine.
M_Line(3) Lines, half-lines and line segments.
M_Matview(3) Visualization widget for M_Matrix(3).
M_Plane(3) Routines related to planes in R3.
M_Plotter(3) General-purpose plotting widget (displays sets of M_Real, M_Vector and M_Complex elements).
M_PointSet(3) Operations on sets of points (e.g., convex hull).
M_Polygon(3) Operations related to polygons in R2 and R3.
M_Quaternion(3) Basic quaternion arithmetic.
M_Rectangle(3) Routines specific to rectangles in R2 and R3.
M_Triangle(3) Routines specific to triangles in R2 and R3.
M_Vector(3) Vectors (optimized R2, R3 and R4 or general Rn).


The ag_net library provides network access methods and implements a modular HTTP/1.1 application server. To use this library, link against agar-net-config --libs.
AG_Net(3) Interface to network services.
AG_Web(3) HTTP/1.1 application server.


The ag_sg library (beta) provides a basic 3D engine. It implements 3D scene-graph, rendering and geometry methods. To use this library, link against agar-sg-config --libs.
SG(3) Base scene graph object.
SG_Image(3) Textured polygon generated from an image surface.
SG_Camera(3) Viewpoint in scene (tied to the SG_View(3) widget).
SG_CgProgram(3) Vertex/fragment program in the Cg language.
SG_Circle(3) Circle (reference geometry).
SG_Geom(3) Base class for reference geometry objects.
SG_Light(3) Light source.
SG_Node(3) Base class for all elements of a SG(3) scene.
SG_Object(3) Base class for polyhedral objects (as brep).
SG_Plane(3) Plane (reference geometry).
SG_Point(3) Single point (reference geometry).
SG_Polygon(3) Polygon (reference geometry).
SG_PolyBall(3) Sphere (as polyhedral approximation).
SG_PolyBox(3) Rectangular box (as polyhedron).
SG_Program(3) Base class for vertex or fragment programs.
SG_Rectangle(3) Rectangle (reference geometry).
SG_Sphere(3) Sphere (reference geometry).
SG_Texture(3) Texture compiled from a set of surfaces.
SG_Triangle(3) Triangle (reference geometry).
SG_View(3) Agar visualization and editor widget for SG(3) scenes.
SG_Voxel(3) Voxel object.


The ag_sk library (beta) implements dimensioned 2D sketches with constraint solving through degree-of-freedom analysis. Sketches contain sets of metric relations (i.e., distances, angles) and logical relations (i.e., coincidence, parallelism, tangency). To use this library, link against agar-sk-config --libs.
SK(3) Base sketch object.
SK_View(3) Agar visualization widget for sketch objects.


The ag_au library (beta) provides a sound interface extends ag_gui with widgets useful in audio applications such as waveform visualizers. To use this library, link against agar-au-config --libs.
AU(3) Audio library initialization.
AU_Wave(3) Structure containing an audio stream.
AU_DevOut(3) Interface to audio output device.


The ag_map library (beta) implements a simple and extensible 2D/3D tile engine. To use this library, link against agar-map-config --libs.
MAP(3) Base map object.
MAP_Actor(3) Map object rendered dynamically.
MAP_View(3) Visualization and edition widget.
RG(3) Feature-based 2D pixel graphics.
RG_Feature(3) Base feature framework.
RG_Pixmap(3) A pixmap image element.
RG_Sketch(3) A vector sketch element.
RG_Texture(3) A texture element.
RG_Tile(3) Base tile element.
RG_Tileview(3) Edition and visualization widget.


The ag_vg library implements basic 2D vector graphics display. It includes an editor tool framework. Geometrical placement of elements is determined by linear transformations using floating-point methods. To use this library, link against agar-vg-config --libs.
VG(3) Vector drawing object.
VG_View(3) Display and edition widget.
VG_Arc(3) Arc entity.
VG_Circle(3) Circle entity.
VG_Line(3) Line entity.
VG_Polygon(3) Polygon entity.
VG_Text(3) Text entity.


Manual pages are provided for most Agar object classes. Some sections are standard throughout the documentation:
INHERITANCE HIERARCHYList of inherited parent classes (see AG_Object(3) for details on inheritance).
EVENTSThe list of events defined (or raised) by this object (see AG_Event(3) for details on events).
STRUCTURE DATAList of public structure members which are safe to access directly. Multithreaded applications must use AG_ObjectLock(3) prior to accessing this data (although in some contexts, such as inside event handler routines, objects can be presumed locked; see AG_Threads(3) for details).

SEE ALSO ElectronTubeStore