The Fast Light Environment Kit


The Flek Hacking Guide

  1. Flek Zen - Coding philosophy.
  2. Flek Style - Coding conventions.
  3. Flek Doc - Documentation conventions.

Flek Zen

Flek adopts a minimalist C++ philosophy. Flek is written in a subset of the ISO C++ standard in order to maximize portability, minimize excessive memory usage and code complexity.

Flek source code should not use any templates, including the STL.

As an application developer, you may choose to use every standard c++ features ever conceived in your application if that's your perogative. And if you don't, Flek won't force them on you. Flek intends to be usable by as many programmers, and in as many programming environments as possible.

Flek Style

Flek follows most of the same conventions that Fltk does and most of the GNU coding guidelines. For more information on the GNU coding guidelines, see the online documentation.

Some basic tips:

For example:

void my_function() {
  // Do it in style.
  for(int i = 0; i < n; i++) {
    do_something(i);
    if(m[i] == q)
      do_something_else(i, true);
  }
}

Naming Conventions

Flek uses most of the same naming conventions as Fltk. Methods are named like_this (and not likeThis), and widget are named like "Fl_My_Widget". But Flek datatypes use a prefix of "F" instead of "Fl_" to distinguish them from widgets.

ScanDoc (Documentation Conventions)

Flek incorporates a JavaDoc style documentation scheme (ScanDoc) and standard class and method naming conventions.

ScanDoc comments are a superset of javadoc. In addition to JavaDoc comment markup, HTML markup is also allowed. All Flek documentation is maintained in HTML form and then converted to other convenient formats like PostScript and PDF.

Header files (.h | .H) typically represent the library interface or API and source files (.cxx) typically represent the library implementation. Thus, FlekDoc interface documentation should be maintained in the header files and implementation comments should be maintained in the source files. The Flek reference documentation is automatically generated from the embedded FlekDoc comments in the header files. Here is an example comment,

/**
 * Convert to a rotation matrix. Assumes that the quaternion has 
 * been normalized
 *
 * @return The converted matrix.
 */
FMatrix3x3 to_matrix (void) const;

Flek Application Guidelines

Desktop Entry

Every Flek Application needs one of these files in order to show up in the Flek menu. Flek will also create appropriate Gnome and KDE files if either of these environments is detected.

<flek:application 
     name        = "Black Ink" 
     name[sp]    = "Nigra Tinta"
     description = "Black Ink is a checkbook / financial management application."
     exec        = "blackink"
     icon        = "BlackInk.xpm"
     type        = "Application" />


Last modified: Thu Feb 24 13:09:24 CST 2000