-
Notifications
You must be signed in to change notification settings - Fork 22
Structures
For reference purposes, here is an explanation of how a Multiload-ng plugin is structured.
-
All the widgets are inside a main container widget, a GtkEventBox that is responsible of receiving and parsing mouse events (hover and click).
-
Inside the container widget there is a box (GtkVBox or GtkHbox) that contains all visible graphs. Orientation of this GtkBox (horizontal or vertical) is the final plugin orientation.
-
box contains one or more main_widget (GtkVBox), one for each visible graph. This is the container widget for a single graph.
-
Another GtkVBox (box) and an inner GtkDrawingArea (disp) complete the widget structure.
Plugin Container (XfcePlugin / LxPlugin / MateApplet / ...) | +--- MultiloadPlugin->container (GtkEventBox) | +--- MultiloadPlugin->box (GtkVBox / GtkHBox) - defines plugin orientation | +--- LoadGraph->main_widget (GtkVBox) - one child for each graph | +--- LoadGraph->box (GtkVBox) | +--- LoadGraph->disp (GtkDrawingArea)
Plugin data is stored in some data structures:
- MultiloadPlugin contains global config and widget data
- LoadGraph contains graph data
- GraphConfig contains graph settings (colors and visibility)
- GraphType contains constant static values (like graph names and default colors)
Every plugin instance has one and only one associated MultiloadPlugin. This structure contains one LoadGraph and one GraphConfig for every graph.
All current implementations are single-instance and single-thread, but in theory GraphType could be shared between instances as it only contains static hardcoded data.
Plugin instance | +--- GraphType | +--- MultiloadPlugin | +--- LoadGraph[GRAPH_MAX] | +--- GraphConfig[GRAPH_MAX]