Concepts

Applet Types

The applet type is the identifier representing a type of applets to the panel. It is a simple string, like HelloWorldApplet and is unique per applet factory.

Applet Factory

The applet factory is an implementation detail that is mostly hidden by the Panel Applet library, but it still appears in a few places (PANEL_APPLET_OUT_PROCESS_FACTORY(), PANEL_APPLET_IN_PROCESS_FACTORY() and .panel-applet files) so it is important to understand what is an applet factory.

The applet factory is the object that will create a new applet instance when the panel requests a new applet to be created. It is identified with a simple string id, for example HelloWorldFactory.

The requests the applet factory will receive from the panel specify which type of applet should be created. This is what makes it possible to have more than one applet types in one applet binary. In most cases, however, the applet factory will be specific to only one applet type. The map between applet types and the applet factory is recorded in .panel-applet files.

There is only one applet factory per applet binary, and it is always running before any applet instance is created by the applet binary. The applet factory is created via PANEL_APPLET_OUT_PROCESS_FACTORY() or PANEL_APPLET_IN_PROCESS_FACTORY().

Applet Instances

There is no restriction as to how many instances of one applet type can be created. The user might choose to add more than one HelloWorldApplet applets to his panels. This can have some implications on the design used to write applets. The most important implication is that it is generally wrong to have global variables to keep a state specific to an applet instance.