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:
- GTK uses
Gtk - libadwaita uses
Adw - Pango uses
Pango - GStreamer uses
Gst - WebKitGTK uses
WebKit - libdex uses
Dex - libsoup uses
Soup - libportal uses
Xdp(for “XDG desktop portal”) - libdazzle uses
Dzl
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.