Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Naming Conventions

Your class has two names: the C++ name, and the GObject type name. The GObject type name is the one you’d see in various debug output, in the GTK inspector, and use in Gtk.Builder files (including Blueprints).

In order for types defined by various libraries not to clash, the well established convention is for each project to pick a namespace, and use it as a type name prefix (among other things). Conventionally, this prefix is short, and, should it consist of multiple words, in UpperCamelCase.

Examples of prefixes used by various projects are:

Then, peel’s convention is to map these namespaces to C++ namespaces; for instance, the GObject type name of GtkButton corresponds to peel::Gtk::Button in peel.

We recommend that you follow these same conventions. Pick a short namespace for your project, and use it both as a prefix for GObject type names, and as a C++ namespace (though not under peel::). If you pick Foo for a namespace and have a class named Frobnicator, its GObject type name should be FooFrobnicator, a the C++ name should be Foo::Frobnicator.

In this documentation, the namespace used for examples is Demo.