GLib

Last updated
GLib
Original author(s) Shawn Amundson
Developer(s) The GNOME Project et al.
Initial release1998;26 years ago (1998)
Stable release
2.80.2 [1]   OOjs UI icon edit-ltr-progressive.svg / 8 May 2024;13 days ago (8 May 2024)
Repository
Written in C
Operating system Linux, Unix-like, macOS, Windows
Platform Cross-platform
Type Library
License LGPLv2.1
Website www.gtk.org
Simplified software architecture of GTK, Pango, GDK, ATK, GIO, Cairo and GLib. GTK+ software architecture.svg
Simplified software architecture of GTK, Pango, GDK, ATK, GIO, Cairo and GLib.

GLib is a bundle of three (formerly five) low-level system libraries written in C and developed mainly by GNOME. GLib's code was separated from GTK, so it can be used by software other than GNOME and has been developed in parallel ever since.

Contents

The name "GLib" originates from the project's start as a GTK C utility library.

Features

GLib provides advanced data structures, such as memory chunks, doubly and singly linked lists, hash tables, dynamic strings and string utilities, such as a lexical scanner, string chunks (groups of strings), dynamic arrays, balanced binary trees, N-ary trees, quarks (a two-way association of a string and a unique integer identifier), keyed data lists, relations, and tuples. Caches provide memory management.

GLib implements functions that provide threads, thread programming and related facilities such as primitive variable access, mutexes, asynchronous queues, secure memory pools, message passing and logging, hook functions (callback registering) and timers. GLib also includes message passing facilities such as byte order conversion and I/O channels.

Some other features of GLib include:

Components

The GLib package consisted of five libraries, but they were all merged into one library, since then named simply GLib, and are no longer sustained as standalone libraries. The original libraries were:

Of these, three continue to reside in distinct subdirectories of the source tree, and so can be thought of as discrete components: GLib, GObject, and GIO. These can be thought of as a software stack: GObject relies on GLib, and GIO provides higher-level functionality that uses both.

History

GLib began as part of the GTK+ project, now named GTK. However, before releasing GTK+ version 2, the project's developers decided to separate code from GTK+ that was not for graphical user interfaces (GUIs), thus creating GLib as a separate software bundle. GLib was released as a separate library so other developers, those not using the GUI-related parts of GTK+, could use the non-GUI parts of the library without the overhead of depending on the full GUI library.

Since GLib is a cross-platform library, applications using it to interface with the operating system are usually portable across different operating systems without major changes. [2]

Releases

Glib is undergoing active development. For a current overview see https://gitlab.gnome.org/GNOME/glib/-/blob/main/NEWS. The table below documents major patch notes from 1998 to 2022.

Release seriesInitial
release date
Major enhancements
GLib 1.x
1.1 1998-09-12
1.2 1999-02-27
1.3 2001-09-25
GLib 2.x
2.0 2002-03-08
2.24 2010-03-26GVariant, GConverted
2.26 2010-09-27 GSettings, GDbus, GObject property bindings (GAtomic for refcounting)
2.30 2011-09-26Non-unique GApplications, use eventfd() for mainloop wakeup, GHashTable set optimization, GObject data scalability
2.32 2012-03-24 Plans for GLib 2.32
2.34 2012-09-23 What's New for Developers in GLib 2.34
2.36 2013-03-25
2.38 2013-09-23applications launched using D-Bus activation [3] GSubprocess, Unicode 6.3 (released September 2013)
2.40 2014-03-24GNotification, System notification API [4]
2.42 2014-09-22
2.43 2014-10-27
2.44 2015-03-23
2.45 2015-04-30
2.46 2015-09-21
2.47 2015-10-26
2.48 2016-03-22
2.50 2016-09-19
2.52 2017-03-19
2.53 2017-04-25
2.54 2018-01-08
2.55 2018-02-06
2.56 2018-03-12
2.57 2018-05-05
2.58 2018-08-30
2.59 2018-12-23
2.60 2019-03-04
2.61 2019-04-15
2.62 2019-09-05
2.63 2019-10-04
2.64 2020-02-27
2.65 2020-06-18
2.66 2020-09-10
2.67 2020-10-23
2.68 2021-03-18
2.69 2021-07-06
2.70 2021-09-17
2.71 2021-12-16
2.72 2022-03-17

Similar projects

Other libraries provide low-level functions and implementations of data structures, including:

Related Research Articles

wxWidgets Widget toolkit

wxWidgets is a widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. wxWidgets enables a program's GUI code to compile and run on several computer platforms with minimal or no code changes. A wide choice of compilers and other tools to use with wxWidgets facilitates development of sophisticated applications. wxWidgets supports a comprehensive range of popular operating systems and graphical libraries, both proprietary and free, and is widely deployed in prominent organizations.

<span class="mw-page-title-main">FLTK</span>

Fast Light Toolkit (FLTK) is a cross-platform widget library for graphical user interfaces (GUIs), developed by Bill Spitzak and others. Made to accommodate 3D graphics programming, it has an interface to OpenGL, but it is also suitable for general GUI programming.

<span class="mw-page-title-main">PyQt</span> Python GUI library

PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this means a variety of licenses including GNU General Public License (GPL) and commercial license, but not the GNU Lesser General Public License (LGPL). PyQt supports Microsoft Windows as well as various kinds of UNIX, including Linux and MacOS.

<span class="mw-page-title-main">PyGTK</span> Set of Python wrappers for the GTK graphical user interface library

PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.

GNOME-DB is a database application by the GNOME community. The project aims to provide a free unified data access architecture to the GNOME project for all Unix platforms. GNOME-DB is useful for any application that accesses persistent data, since it contains a data management API.

<span class="mw-page-title-main">GObject</span> Free software library

The GLib Object System, or GObject, is a free software library providing a portable object system and transparent cross-language interoperability. GObject is designed for use both directly in C programs to provide object-oriented C-based APIs and through bindings to other languages to provide transparent cross-language interoperability, e.g. PyGObject.

<span class="mw-page-title-main">GDK</span> Software library

GDK is a library that acts as a wrapper around the low-level functions provided by the underlying windowing and graphics systems. GDK lies between the display server and the GTK library, handling basic rendering such as drawing primitives, raster graphics (bitmaps), cursors, fonts, as well as window events and drag-and-drop functionality.

<span class="mw-page-title-main">Apache Portable Runtime</span> Supporting library for the Apache web server

The Apache Portable Runtime (APR) is a supporting library for the Apache web server. It provides a set of APIs that map to the underlying operating system (OS). Where the OS does not support a particular function, APR will provide an emulation. Thus programmers can use the APR to make a program truly portable across platforms.

<span class="mw-page-title-main">Vala (programming language)</span> Programming language

Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system.

Clutter is a discontinued GObject-based graphics library for creating hardware-accelerated user interfaces. Clutter is an OpenGL-based 'interactive canvas' library and does not contain any graphical control elements. It relies upon OpenGL (1.4+) or OpenGL ES for rendering,. It also supports media playback using GStreamer and 2D graphics rendering using Cairo.

GVfs is GNOME's userspace virtual filesystem designed to work with the I/O abstraction of GIO, a library available in GLib since version 2.15.1. It installs several modules that are automatically used by applications using the APIs of libgio. There is also FUSE support that allows applications not using GIO to access the GVfs filesystems.

<span class="mw-page-title-main">GIO (software)</span>

GIO is a library, designed to present programmers with a modern and usable interface to a virtual file system. It allows applications to access local and remote files with a single consistent API, which was designed "to overcome the shortcomings of GnomeVFS" and be "so good that developers prefer it over raw POSIX calls."

<span class="mw-page-title-main">GTK</span> Free and open-source cross-platform widget toolkit for creating graphical user interfaces

GTK is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.

<span class="mw-page-title-main">GNOME</span> Desktop environment for Linux and other Unix-like systems

GNOME, originally an acronym for GNU Network Object Model Environment, is a free and open-source desktop environment for Linux and other Unix-like operating systems.

Genie is a modern, general-purpose high-level programming language in development since 2008. It was designed as an alternative, simpler and cleaner dialect for the Vala compiler, while preserving the same functionality of the Vala language. Genie uses the same compiler and libraries as Vala; the two can indeed be used alongside each other. The differences are only syntactic.

Seed is a JavaScript interpreter and a library of the GNOME project to create standalone applications in JavaScript. It uses the JavaScript engine JavaScriptCore of the WebKit project. It is possible to easily create modules in C.

sigrok

sigrok is a portable, cross-platform, free open source signal analysis software suite that supports various device types, such as logic analyzers, MSOs, oscilloscopes, multimeters, LCR meters, sound level meters, thermometers, hygrometers, anemometers, light meters, DAQs, data loggers, function generators, spectrum analyzers, power supplies, IEEE-488 (GPIB) interfaces, and more.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

References

  1. "2.80.2 · GNOME / GLib · GitLab" . Retrieved 10 May 2024.
  2. Krause, Andrew (2007). Foundations of GTK+ Development . Expert's Voice in Open Source. Apress. p.  5. ISBN   978-1-59059-793-4 . Retrieved 3 April 2013. [GLib] provides a cross-platform interface that allows your code to be run on any of its supported operating systems with little to no rewriting of code!
  3. "Setting up an application for D-Bus Launching".
  4. "GNotification".