HDStatusPluginItem

HDStatusPluginItem — Base class for plugable status Hildon Status Area items.

Synopsis


#include <libhildondesktop/libhildondesktop.h>

                    HDStatusPluginItem;
void                hd_status_plugin_item_set_status_area_icon
                                                        (HDStatusPluginItem *item,
                                                         GdkPixbuf *icon);
void                hd_status_plugin_item_set_status_area_widget
                                                        (HDStatusPluginItem *item,
                                                         GtkWidget *widget);
DBusConnection*     hd_status_plugin_item_get_dbus_connection
                                                        (HDStatusPluginItem *item,
                                                         DBusBusType type,
                                                         DBusError *error);
DBusGConnection*    hd_status_plugin_item_get_dbus_g_connection
                                                        (HDStatusPluginItem *item,
                                                         DBusBusType type,
                                                         GError **error);
const gchar*        hd_status_plugin_item_get_dl_filename
                                                        (HDStatusPluginItem *item);
guint               hd_status_plugin_item_heartbeat_signal_add
                                                        (HDStatusPluginItem *item,
                                                         guint mintime,
                                                         guint maxtime,
                                                         GSourceFunc source_func,
                                                         gpointer data,
                                                         GDestroyNotify destroy);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----HDStatusPluginItem
                                       +----HDStatusMenuItem

Implemented Interfaces

HDStatusPluginItem implements AtkImplementorIface, GtkBuildable and HDPluginItem.

Properties

  "status-area-icon"         GdkPixbuf*            : Read / Write
  "status-area-visible"      gboolean              : Read / Write
  "status-area-widget"       GtkWidget*            : Read / Write

Description

Base class for all plugable status Hildon Status Area items. Status Area plugin developer should usually also provide an item in the Status Menu and should therefore derive from HDStatusMenuItem instead of HDStatusPluginItem.

The class provides the hd_status_plugin_item_set_status_area_icon() function to set or update the Status Area icon. The icon must be a 18x18 pixel sized GdkPixbuf.

The hd_status_plugin_item_get_dl_filename() function can be used to get the filename of the dynamic library for debugging purposes.

Plugins should use private D-Bus connections. There is the hd_status_plugin_item_get_dbus_connection() function which should be used to create such connections.

Details

HDStatusPluginItem

typedef struct _HDStatusPluginItem HDStatusPluginItem;


hd_status_plugin_item_set_status_area_icon ()

void                hd_status_plugin_item_set_status_area_icon
                                                        (HDStatusPluginItem *item,
                                                         GdkPixbuf *icon);

Sets the Status Area icon corresponding to this item to icon. The icon must have a size of 18x18 pixel.

To hide (or unset) the Status Area icon use NULL for icon.

item : a HDStatusPluginItem
icon : a GdkPixbuf used as the new icon or NULL

hd_status_plugin_item_set_status_area_widget ()

void                hd_status_plugin_item_set_status_area_widget
                                                        (HDStatusPluginItem *item,
                                                         GtkWidget *widget);

Sets a widget which should be displayed in the Status Area. This function should only be used by the Clock plugin.

item : a HDStatusPluginItem
widget : a GtkWidget which should be displayed in the Status Area

hd_status_plugin_item_get_dbus_connection ()

DBusConnection*     hd_status_plugin_item_get_dbus_connection
                                                        (HDStatusPluginItem *item,
                                                         DBusBusType type,
                                                         DBusError *error);

Creates a new private DBusConnection to the D-Bus session or system bus.

It is similar to the dbus_bus_get_private() function but in contrast to the dbus_bus_get_private() function the application will not exit if the connection closes. Additionally this function is used to map the unique D-Bus name to the plugin.

So this function should be used by plugins to create D-Bus connections.

item : A HDStatusPluginItem
type : The DBusBusType DBUS_BUS_SESSION or DBUS_BUS_SYSTEM
error : A DBusError to return error messages
Returns : A new private connection to bus type. The connection must be unrefed with dbus_connection_unref() when it is not longer needed.

hd_status_plugin_item_get_dbus_g_connection ()

DBusGConnection*    hd_status_plugin_item_get_dbus_g_connection
                                                        (HDStatusPluginItem *item,
                                                         DBusBusType type,
                                                         GError **error);

Creates a new DBusGConnection to the D-Bus session or system bus.

Internally, calls dbus_g_bus_get(). See there for further informations.

item : A HDStatusPluginItem
type : The DBusBusType DBUS_BUS_SESSION or DBUS_BUS_SYSTEM
error : A GError to return error messages
Returns : A shared connection.

hd_status_plugin_item_get_dl_filename ()

const gchar*        hd_status_plugin_item_get_dl_filename
                                                        (HDStatusPluginItem *item);

Returns the filename of the dynamic library file from which this item was loaded. Useful for debugging purposes.

item : a HDStatusPluginItem
Returns : filename of the dynamic library file. The result must not be freed.

hd_status_plugin_item_heartbeat_signal_add ()

guint               hd_status_plugin_item_heartbeat_signal_add
                                                        (HDStatusPluginItem *item,
                                                         guint mintime,
                                                         guint maxtime,
                                                         GSourceFunc source_func,
                                                         gpointer data,
                                                         GDestroyNotify destroy);

Sets a function to be called at regular intervals. The source_func is called repeatedly until it returns FALSE, at which point it is automatically destroyed and the function will not be called again.

It is wise to have maxtime-mintime quite big so all users of this service get synced.

If iphb is not avaiable g_timeout_add_seconds_full() is used with maxtime as interval.

See iphb_wait() for more information.

item : A HDStatusPluginItem.
mintime : Time in seconds that must be waited before source_func is called, or 0.
maxtime : Time in seconds when the wait must end.
source_func : Function to call.
data : Data to pass to function.
destroy : Function to call when the signal is removed, or NULL.
Returns : The ID (greater than 0) of the event source.

Property Details

The "status-area-icon" property

  "status-area-icon"         GdkPixbuf*            : Read / Write

The Status Area icon which should be displayed for the item.


The "status-area-visible" property

  "status-area-visible"      gboolean              : Read / Write

Whether the status area the plugin belongs to is visible (maintained by the status area itself).

Default value: TRUE


The "status-area-widget" property

  "status-area-widget"       GtkWidget*            : Read / Write

The widget which should be displayed in the Status Area (should be used by clock plugin only).