Table of Contents

Scope

Every Xfce panel plugin is required to reimplement UI, which makes writing basic plugins more difficult and leads to UI inconsistencies.

There is a need for a generic plugin that provides basic UI (icon, label(s), menu, etc., see below) and allows the plugin writer to implement only data collection logic.

Question: should this mechanism allow independent applications communicate with the plugin (e.g. via dbus) and display “indicators” on the panel (that's how indicator plugin works)? Even if such functionality is not needed now, it may be necessary if the panel is used in a non-X environment (one that does not support widget embedding). So far, this page assumes that this feature is not needed. — Andrzej 2013/03/19 00:00

Basic Architecture

The plugin should be partitioned into two components:

The panel should not assume that monitor-logic is implemented as e.g. a library written in C. In the future, this could be used for writing monitor plugins in scripting languages.

Preferably, the library should provide a base class of a monitor-logic object, with some virtual functions populated.

Note: I had started some months ago a skeleton of a gobject monitor plugin, intending to merge all monitors inside it, and using libgtop & upower for data collection. See http://rhaalovely.net/cgit/xfce4-monitor-plugin/. — Landry Breuil 2013/03/18 22:05

Features

Essential

Optional

UI mockups

Horizontal panel

Deskbar mode

Vertical panel

Sample API

Monitor UI

Monitor-UI API would be visible to the panel.

Monitor logic

Monitor-logic API would be visible to a plugin developer.

class XfceMonitor extends GObject
    
    //fields
    list of XfceMonitorButton
    
    //methods
    get_monitor_buttons()
    
    has_about() // should "About" info be required 
    
    get_name() // or taken from .desktop?
    
    get_plugin_icon() // ditto
    
    get_desciption() // ditto
    
    get_copyright()
    
    get_detail_desciption()
    
    get_credits() // perhaps hardcoded
    
    get_license() // ditto
    
    has_properties() // for config dialog
    
    properties_clicked() // show a config dialog from XfceMonitor object(?)
                         // ideally, this should be handled by XfceMonitorUI object instead
                         // (like "About") but that would require describing the dialog somehow
                         // (glade?)
    
    //signals
    signal monitor_button_added(button)
    
    signal monitor_button_removed(button)
    
    signal monitor_buttons_reordered

class XfceMonitorButton extends GObject
    
    //fields
    icon(s)
    list of text_labels
    
    
    //methods
    get_icon(size)
    
    signal icon_changed()
    
    get_label_list()
    
    signal label_list_changed()
    
    
    //primary action
    get_primary_action_type() // returns enum: None, Callback, Menu, Range, TextField
    
    primary_action_callback()
    
    get_primary_menu()
    
    signal primary_menu_changed()
    
    primary_action_range_changed (percentage)
    
    primary_action_text_entered (text)
    
    
    //secondary action
    get_secondary_action_type() // returns enum: None, Callback, Menu, Range, TextField
    
    secondary_action_callback()
    
    get_secondary_menu()
    
    signal secondary_menu_changed()
    
    secondary_action_range_changed (percentage)
    
    secondary_action_text_entered (text)
    
    
    //tooltip --- // Andrzej 2013/03/18 10:58//
    
    has_tooltip()
    
    get_tooltip_icon() //optional(?), return NULL if there is no icon
    
    get_tooltip_label()
    
    signal tooltip_changed()
    
    
    //mouse wheel event
    mouse_wheel_event(direction)
    
    
    //progress bar
    has_progress_bar()
    
    progress_bar_value()
    
    signal progress_bar_changed() // either value or visibility
    
    // polling mechanism
    polling_enabled()
    
    get_poll_interval() // returns interval in # of seconds
    
    signal poll_interval_changed() //changed interval or polling enabled/disabled
    
    poll_event(time)

Sample API 2

http://users.xfce.org/~nick/proposal/indicator-api/