Xfce.org | Xfce Goodies | Xfce Foundation Classes | Xfce Bug Tracker | Xfce Wiki | Xfce Forum | Xfce DevBlog    

... the power of gtk, the power of c++!

Home | News | History | FAQ | Documentation | Download | Contact | Links

Online Documentation

The Xfce Foundation Classes comes with excellent documentation, all of which can be viewed online here
  • There is a large collection of widget HOWTOs that cover everything from general information and library structure to individual widget programming. Each widget HOWTO first discusses any widget basics and then works through a widget example. The HOWTOs are linked to the API reference manual so widget examples can be easily accessed from there.
  • There is a complete API reference manual. This manual is compiled by Doxygen from special comments in the XFC header files. Every typedef, enum and class has been documented, including all public and protected member functions and signals.
  • There is a good tutorial that targets both new and experienced GTK+ programmers. The tutorial takes you through the process building a real application, called 'XfcApp', which you can then use as the starting point for your own projects. The tutorial covers two important topics essential for new programmers: building a GNU autotools project and adding international language support.

Minimum Requirements

The libXFCcore library depends on the following:

The libXFCui library depends on libXFCcore and the following:
  • ATK 1.9.0 or higher
  • GTK+ 2.6.0 or higher
  • Pango 1.8.0 or higher

Most Linux distributions include these packages. Just make sure that the development packages are also installed on your system. Once XFC is installed you will find a complete reference manual and a tutorial in the <docs> directory. If the API reference manual is missing for some reason, don't worry. It's very likely your Linux distribution comes with a program called Doxygen, which should be in your <usr/bin> directory. When you run make for the first time, XFC will use Doxygen to compile the API reference manual from special comments in the header files.

Installing from source code

The first thing to do of course is download to the latest version of the source code.  The Xfce Foundation Classes uses GNU Autoconf for configuration, so once untar'd run configure with the --help argument to see a list of options. You should use the GNU compiler version 3.2.0 (or higher) to compile XFC.

You can compile and install XFC with the following commands run in the top-level source directory:

$ ./configure --prefix=directory
$ make
$ make install

The '--prefix' argument takes the directory where you want XFC installed. If the directory is omitted XFC will install itself into the <usr/local> directory. By default, configure builds libXFCcore and libXFCui with debugging and compiler symbols so you can debug your applications during development. If you want libXFCcore and libXFCui built without debugging symbols, run configure with the following option:

./configure --disable-debug

Alternativley, you can install the libXFCcore and libXFCui libraries with all debugging symbols stripped out by calling:

make install-strip

The stripped libraries are much smaller, and faster: libXFCcore is just 220 kbytes and libXFCui is 2.3 megabytes.

If you don't want to build the API reference, or if you don't have Doxygen installed, run configure with the following option:

./configure --disable-docs

Other configure options include: --disable-demos, --disable-examples and --disable-tests, which disable the implied feature so it wont get compiled.

Compiling a XFC Application

To compile an XFC application you need to use pkg-config which can be obtained from freedesktop.org. pkg-config is a tool for managing library compile and link flags during make file exceution. It reads the xfcui-X.X.pc file (X.X is the version number) which comes with XFC to determine what compiler switches are needed to compile a XFC program. The --cflags option will output a list of include directories for the compiler to look in, and the --libs option will output the list of libraries for the compiler to link with and the directories to find them in. For example, a typical compile command would look like this:

g++ -Wall -g -O2 helloworld.cc -o helloworld `pkg-config xfcui-X.X --cflags --libs`

Replace X.X with the major and minor version numbers of the libXFCui library installed on your system.  Note that the type of single quote used in the compile command above is significant.



Valid XHTML 1.0  
    Copyright © 2004-2005 The XFC Development Team Xfce is © Olivier FOURDAN 1996-2005