XForms (Toolkit)

from Wikipedia, the free encyclopedia
XForms

XForms-Form-Designer.png
The XForms Form Designer
Basic data

Maintainer Jens Thoms Törring
Current  version 1.2.4
(June 28, 2014)
operating system unixoid system
programming language C.
category GUI toolkit
License Since April 2002 under GNU LGPL 2.1
XForms Toolkit
XForms has direct access to the Xlib library

XForms is a GUI toolkit based on the Xlib library of the X Window System . It contains many widget objects implemented in C , such as buttons, scroll bars, program menus and other control elements. XForms was programmed by T. C. Zhao and Mark Overmars , who initially published it in a version that was free for non-commercial users. In April 2002, with the release of version 0.9999, the complete toolkit was placed under the GNU Lesser General Public License .

origin

The XForms toolkit was originally developed on Silicon Graphics workstations using the IRIS Graphics Library ( IRIS GL ), the proprietary predecessor version of OpenGL under IRIX , but was later ported to any X11 system using the Xlib library . In contrast to the Athena Widgets ( Xaw ), Motif (Xm) or OpenLook ( XView ), the Toolkit does not use the X-Toolkit (Xt) and implements all widgets via direct access to the Xlib library. There are several names for the toolkit such as “Forms Library for X”, “Forms Library” or simply “XForms”, but all of these refer to the same toolkit. With the aim of replacing XForms, the C ++ -based Fast Light Toolkit (FLTK) was later developed on the basis of the XForms library. The XForms Toolkit is thus distantly related to the FLTK.

Functionality and special features

Any program that uses XForms as an interface uses one or more forms, with a shape representing a simple window under the X. A "shape" is a box in which you can place widget objects such as buttons, selection fields and input fields. One of the special features of the toolkit is the XForms Form Designer, a supplied interactive surface editor for creating graphical surfaces. It enables the programmer to develop his programs using Rapid Application Development (RAD). The form designer allows you to create new forms and their objects, to group them and to edit their properties.

The XForms programming model implements the reaction to events, such as clicking a checkbox, with callbacks . For example, if a shape has multiple buttons, each can be assigned its own callback function. The main loop of the program waits for events and, if this event affects a certain object, the corresponding callback function is executed. In addition, there are connections to the programming languages Perl , Ada95 , Fortran , Pascal , SCM / Guile and Python . The XForms Toolkit can be used under the operating systems IRIX , SunOS / Solaris , HP-UX , AIX , Tru64 UNIX , Linux , macOS , FreeBSD , NetBSD , OpenBSD , UnixWare , OpenVMS , OS / 2 and Windows NT 4.0 , the latter three are no longer actively maintained in the source code .

Areas of application

The toolkit was originally used by the Xfce project to design the graphical user interface before moving to the GIMP toolkit . Also LyX , the graphical WYSIWYG frontend to LaTeX , sat for a long time XForms as a base one; As of version 1.5, only the Qt library is used because of the lack of Unicode support in the XForms Toolkit . Other well-known programs that use the XForms Toolkit are the e-mail client XFMail, the fax viewer xfax, the processing program for audio files Digital Audio Processor (DAP) and the commercial CAD program for the Arcad architecture sector .

Sample code

Here is a small sample program for a window with an "Okay" button :

#include <forms.h>

int main( int argc, char *argv[] )
{
    FL_FORM *form;
    fl_initialize( &argc, argv, 0, 0, 0 );
    form = fl_bgn_form( FL_UP_BOX, 230, 160 );
    fl_add_button( FL_NORMAL_BUTTON, 40, 50, 150, 60, "OK" );
    fl_end_form();

    fl_show_form( form, FL_PLACE_MOUSE, FL_NOBORDER, "Hello, world!" );
    fl_do_forms(); /* main event loop */
    fl_hide_form(form);
    fl_finish();
    return 0;
}

Web links

Individual evidence

  1. xforms.git GNU Savannah