IUP (software)

{{Short description|Computer software development kit}}

{{Primary sources|date=November 2009}}

{{Infobox software

| name = IUP

| screenshot = IUP-screenshot.png

| screenshot size = 100px

| logo =

| caption =

| author = [http://www.tecgraf.puc-rio.br/ Tecgraf]/PUC-Rio in collaboration with Petrobras

| latest release version = 3.32

| latest release date = {{Start date and age|2025|01|06|df=y}}

| operating system = Cross-platform

| genre = Software development kit

| license = MIT

| website = {{URL|www.tecgraf.puc-rio.br/iup}}

}}

The IUP Portable User Interface is a computer software development kit that provides a portable, scriptable toolkit to build graphical user interfaces (GUIs) using the programming languages C, Perl, Lua, Nim and Zig, among others.{{Cite web |title=IUP for Zig |url=https://zig.news/batiati/iup-for-zig-4ah |access-date=2023-05-16 |website=Zig NEWS |date=19 September 2021 |language=en}} This allows rapid, zero-compile prototyping and refinement of deployable GUI applications.

IUP's purpose is to allow programs user interface to run in different systems in unmodified form.{{Cite web|title = IUP - Portable User Interface|url = http://www.tecgraf.puc-rio.br/iup/|website = www.tecgraf.puc-rio.br|access-date = 2016-09-24}}

It provides this ability by binding Lua with its C/C++ code, or simply writing C to the application programming interface (API). It handles user interface elements by using native controls provided by native APIs, such as Windows API in Windows, GTK+ in Linux, and Motif-LessTif in older Unices. It also provides some custom developed controls using graphics APIs such as CD - Canvas Draw or OpenGL.

Features

IUP's distinguishing features include:

  • ANSI C API, one of the few plain C-capable toolkits,
  • Single API for Windows or Linux,
  • Built in support for Lua scripts calling IUP functions (controlled by Lua script),
  • Removal of the restriction of class/instance object types, but retaining the prototype Lua-style hierarchy of inheritance.
  • An abstract layout model, in which sizes and positions are calculated from horizontal and vertical containers, rather than explicit X and Y coordinates. Coordinate-based layout is also supported with a third container type.
  • Small API, on the order of about 100 functions.
  • Use of an event loop-callback mechanism. This main loop can be called inside Lua.
  • Interface elements are created before they are mapped to the native elements. This is the reverse of the usual situation for assembling GUI elements.
  • Available as source or pre-built static or dynamic libraries for a wide variety of compilers, including turnkey example source.

The Lua scripting is done by binding Lua and IUPLua in (at least) a small C program called a host application. This program creates a Lua state, passes the Lua state to IUPLua for initialization, and then opens and executes a Lua script against the Lua state. Or, the entire IUP state can be dynamically loaded via use of a Lua require or package.loadlib of IUPLua.

The script(s) can later be compiled with the Lua compiler if needed.

Support for UTF-8 was added to the Windows target in November 2013 with the release of version 3.9.{{Cite web |title=History 3.x |url=https://www.tecgraf.puc-rio.br/iup/en/history3.html |access-date=2023-05-16 |website=www.tecgraf.puc-rio.br}}

References

{{reflist|30em}}