Specifications

CHAPTER 5. IMPLEMENTATION 28
The subsequent sections of this chapter separately discuss the implementation of the three
components. Important attributes of the components are emphasized and the dynamic aspects
are taken into account, too. In the end of this chapter several modules are discussed which
impart the actual functionality of the Input Abstraction Layer.
The complete source code is documented using Doxygen (http://www.doxygen.org/).
Doxygen is an open source documentation system for various programming languages. The
Doxygen documentation addresses developers interested in the Input Abstraction Layer’s im-
plementation while this chapter describes the implementation in a legible way to address
non-developers as well. Further details about the Doxygen do cumentation can be found in
Chapter 7, §7.2.
5.1 Common Data Structures
The Input Abstraction Layer’s components are tied together by using common static data
structures. These data structures are defined in the header files of the library found in
the directory libial. These header files are subdivided into three separate files: libial.h,
libial mod.h and libial log.h. The main header file libial.h includes the remaining two
header files. Beside this, libial.h also includes header files of external libraries used by all
components: D-BUS and GLib. Apart from its similar name, the library GLib has nothing in
common with the glibc GNU C Library. Figure 5.2 shows the include dependency graph for
libial.h.
glib.h dbus/dbus.h dbus/dbus-glib.h dbus/dbus-glib-lowlevel.hlibial_mod.h libial_log.h
External Header Files
Input Abstraction Layer Header Files
libial.h
Figure 5.2: Include Dependency Graph for libial.h
Abstract input events are represented using the data structure IalEvent. This data struc-
ture is used by two components of the Input Abstraction Layer—the library and the modules.
The structure is declared in libial.h:
typedef struct IalEvent_s {
const char *sender;
const char *source;
const char *name;
int raw;
} IalEvent;