AppIndicator

AppIndicator — An object to put application information into the panel.

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libappindicator/app-indicator.h>

#define             APP_INDICATOR_TYPE
#define             APP_INDICATOR                       (obj)
#define             APP_INDICATOR_CLASS                 (klass)
#define             IS_APP_INDICATOR                    (obj)
#define             IS_APP_INDICATOR_CLASS              (klass)
#define             APP_INDICATOR_GET_CLASS             (obj)
#define             APP_INDICATOR_SIGNAL_NEW_ICON
#define             APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON
#define             APP_INDICATOR_SIGNAL_NEW_STATUS
#define             APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH
#define             APP_INDICATOR_SIGNAL_CONNECTION_CHANGED
enum                AppIndicatorCategory;
enum                AppIndicatorStatus;
                    AppIndicatorPrivate;
                    AppIndicator;
                    AppIndicatorClass;
GType               app_indicator_get_type              (void);
AppIndicator *      app_indicator_new                   (const gchar *id,
                                                         const gchar *icon_name,
                                                         AppIndicatorCategory category);
AppIndicator *      app_indicator_new_with_path         (const gchar *id,
                                                         const gchar *icon_name,
                                                         AppIndicatorCategory category,
                                                         const gchar *icon_theme_path);
void                app_indicator_set_status            (AppIndicator *self,
                                                         AppIndicatorStatus status);
void                app_indicator_set_attention_icon    (AppIndicator *self,
                                                         const gchar *icon_name);
void                app_indicator_set_menu              (AppIndicator *self,
                                                         GtkMenu *menu);
void                app_indicator_set_icon              (AppIndicator *self,
                                                         const gchar *icon_name);
void                app_indicator_set_icon_theme_path   (AppIndicator *self,
                                                         const gchar *icon_theme_path);
const gchar *       app_indicator_get_id                (AppIndicator *self);
AppIndicatorCategory  app_indicator_get_category        (AppIndicator *self);
AppIndicatorStatus  app_indicator_get_status            (AppIndicator *self);
const gchar *       app_indicator_get_icon              (AppIndicator *self);
const gchar *       app_indicator_get_icon_theme_path   (AppIndicator *self);
const gchar *       app_indicator_get_attention_icon    (AppIndicator *self);
GtkMenu *           app_indicator_get_menu              (AppIndicator *self);

Object Hierarchy

  GObject
   +----AppIndicator

Properties

  "attention-icon-name"      gchar*                : Read / Write
  "category"                 gchar*                : Read / Write / Construct Only
  "connected"                gboolean              : Read
  "icon-name"                gchar*                : Read / Write / Construct
  "icon-theme-path"          gchar*                : Read / Write / Construct
  "id"                       gchar*                : Read / Write / Construct Only
  "menu"                     DBusGObjectPath*      : Read
  "status"                   gchar*                : Read / Write

Signals

  "connection-changed"                             : Run Last
  "new-attention-icon"                             : Run Last
  "new-icon"                                       : Run Last
  "new-icon-theme-path"                            : Run Last
  "new-status"                                     : Run Last

Description

An application indicator is a way for an application to put a menu into the panel on the user's screen. This allows the user to interact with the application even though it might not be visible to the user at the time. In most cases this is not a good solution as there are other ways to inform the user. It should only be use if persistence is a desired feature for the user (not for your marketing purpose of having your logo in the panel).

Details

APP_INDICATOR_TYPE

#define APP_INDICATOR_TYPE            (app_indicator_get_type ())

Get the GType for a AppIndicator.


APP_INDICATOR()

#define APP_INDICATOR(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), APP_INDICATOR_TYPE, AppIndicator))

Safely convert a GObject into an AppIndicator.

obj :

The object to convert

APP_INDICATOR_CLASS()

#define APP_INDICATOR_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), APP_INDICATOR_TYPE, AppIndicatorClass))

Safely convert a GObjectClass into a AppIndicatorClass.

klass :

GObjectClass based class to convert.

IS_APP_INDICATOR()

#define IS_APP_INDICATOR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), APP_INDICATOR_TYPE))

Checks to see if obj is in the object hierarchy of AppIndicator.

obj :

An GObject to check

IS_APP_INDICATOR_CLASS()

#define IS_APP_INDICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), APP_INDICATOR_TYPE))

Checks to see if klass is in the object class hierarchy of AppIndicatorClass.

klass :

An GObjectClass to check

APP_INDICATOR_GET_CLASS()

#define APP_INDICATOR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), APP_INDICATOR_TYPE, AppIndicatorClass))

Gets a pointer to the AppIndicatorClass for the object obj.

obj :

A GObject in the class hierarchy of AppIndicator.

APP_INDICATOR_SIGNAL_NEW_ICON

#define APP_INDICATOR_SIGNAL_NEW_ICON            "new-icon"

String identifier for the "new-icon" signal.


APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON

#define APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON  "new-attention-icon"

String identifier for the "new-attention-icon" signal.


APP_INDICATOR_SIGNAL_NEW_STATUS

#define APP_INDICATOR_SIGNAL_NEW_STATUS          "new-status"

String identifier for the "new-status" signal.


APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH

#define APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH "new-icon-theme-path"

String identifier for the "new-icon-theme-path" signal.


APP_INDICATOR_SIGNAL_CONNECTION_CHANGED

#define APP_INDICATOR_SIGNAL_CONNECTION_CHANGED  "connection-changed"

String identifier for the "connection-changed" signal.


enum AppIndicatorCategory

typedef enum { /*< prefix=APP_INDICATOR_CATEGORY >*/
	APP_INDICATOR_CATEGORY_APPLICATION_STATUS, /*< nick=ApplicationStatus >*/
	APP_INDICATOR_CATEGORY_COMMUNICATIONS, /*< nick=Communications >*/
	APP_INDICATOR_CATEGORY_SYSTEM_SERVICES, /*< nick=SystemServices >*/
	APP_INDICATOR_CATEGORY_HARDWARE, /*< nick=Hardware >*/
	APP_INDICATOR_CATEGORY_OTHER /*< nick=Other >*/
} AppIndicatorCategory;

The category provides grouping for the indicators so that users can find indicators that are similar together.

APP_INDICATOR_CATEGORY_APPLICATION_STATUS

The indicator is used to display the status of the application.

APP_INDICATOR_CATEGORY_COMMUNICATIONS

The application is used for communication with other people.

APP_INDICATOR_CATEGORY_SYSTEM_SERVICES

A system indicator relating to something in the user's system.

APP_INDICATOR_CATEGORY_HARDWARE

An indicator relating to the user's hardware.

APP_INDICATOR_CATEGORY_OTHER

Something not defined in this enum, please don't use unless you really need it.

enum AppIndicatorStatus

typedef enum { /*< prefix=APP_INDICATOR_STATUS >*/
	APP_INDICATOR_STATUS_PASSIVE, /*< nick=Passive >*/
	APP_INDICATOR_STATUS_ACTIVE, /*< nick=Active >*/
	APP_INDICATOR_STATUS_ATTENTION /*< nick=NeedsAttention >*/
} AppIndicatorStatus;

These are the states that the indicator can be on in the user's panel. The indicator by default starts in the state APP_INDICATOR_STATUS_PASSIVE and can be shown by setting it to APP_INDICATOR_STATUS_ACTIVE.

APP_INDICATOR_STATUS_PASSIVE

The indicator should not be shown to the user.

APP_INDICATOR_STATUS_ACTIVE

The indicator should be shown in it's default state.

APP_INDICATOR_STATUS_ATTENTION

The indicator should show it's attention icon.

AppIndicatorPrivate

typedef struct _AppIndicatorPrivate AppIndicatorPrivate;

All of the private data in an instance of a application indicator.


AppIndicator

typedef struct _AppIndicator AppIndicator;

A application indicator represents the values that are needed to show a unique status in the panel for an application. In general, applications should try to fit in the other indicators that are available on the panel before using this. But, sometimes it is necissary.


AppIndicatorClass

typedef struct {
	/* Parent */
	GObjectClass parent_class;

	/* DBus Signals */
	void (* new_icon)               (AppIndicator      *indicator,
	                                 gpointer            user_data);
	void (* new_attention_icon)     (AppIndicator      *indicator,
	                                 gpointer            user_data);
	void (* new_status)             (AppIndicator      *indicator,
	                                 const gchar       *status,
	                                 gpointer            user_data);

	/* Local Signals */
	void (* connection_changed)     (AppIndicator * indicator,
	                                 gboolean          connected,
	                                 gpointer          user_data);

	/* Overridable Functions */
	GtkStatusIcon * (*fallback)     (AppIndicator * indicator);
	void (*unfallback)              (AppIndicator * indicator,
	                                 GtkStatusIcon * status_icon);

    void (* new_icon_theme_path)    (AppIndicator      *indicator,
                                     const gchar       *icon_theme_path,
	                                 gpointer            user_data);

	/* Reserved */
	void (*app_indicator_reserved_2)(void);
} AppIndicatorClass;

The signals and external functions that make up the AppIndicator class object.

GObjectClass parent_class;

Mia familia

new_icon ()

Slot for "new-icon".

new_attention_icon ()

Slot for "new-attention-icon".

new_status ()

Slot for "new-status".

connection_changed ()

Slot for "connection-changed".

fallback ()

Function that gets called to make a GtkStatusIcon when there is no Application Indicator area available.

unfallback ()

The function that gets called if an Application Indicator area appears after the fallback has been created.

new_icon_theme_path ()

Slot for "new-icon-theme-path"

app_indicator_reserved_2 ()

Reserved for future use.

app_indicator_get_type ()

GType               app_indicator_get_type              (void);

Generates or returns the unique GType for AppIndicator.

Returns :

A unique GType for AppIndicator objects.

app_indicator_new ()

AppIndicator *      app_indicator_new                   (const gchar *id,
                                                         const gchar *icon_name,
                                                         AppIndicatorCategory category);

Creates a new AppIndicator setting the properties: "id" with id, "category" with category and "icon-name" with icon_name.

id :

The unique id of the indicator to create.

icon_name :

The icon name for this indicator

category :

The category of indicator.

Returns :

A pointer to a new AppIndicator object.

app_indicator_new_with_path ()

AppIndicator *      app_indicator_new_with_path         (const gchar *id,
                                                         const gchar *icon_name,
                                                         AppIndicatorCategory category,
                                                         const gchar *icon_theme_path);

Creates a new AppIndicator setting the properties: "id" with id, "category" with category, "icon-name" with icon_name and "icon-theme-path" with icon_theme_path.

id :

The unique id of the indicator to create.

icon_name :

The icon name for this indicator

category :

The category of indicator.

icon_theme_path :

A custom path for finding icons.

Returns :

A pointer to a new AppIndicator object.

app_indicator_set_status ()

void                app_indicator_set_status            (AppIndicator *self,
                                                         AppIndicatorStatus status);

Wrapper function for property "status".

self :

The AppIndicator object to use

status :

The status to set for this indicator

app_indicator_set_attention_icon ()

void                app_indicator_set_attention_icon    (AppIndicator *self,
                                                         const gchar *icon_name);

Wrapper function for property "attention-icon-name".

self :

The AppIndicator object to use

icon_name :

The name of the attention icon to set for this indicator

app_indicator_set_menu ()

void                app_indicator_set_menu              (AppIndicator *self,
                                                         GtkMenu *menu);

Sets the menu that should be shown when the Application Indicator is clicked on in the panel. An application indicator will not be rendered unless it has a menu. Wrapper function for property "menu".

self :

The AppIndicator

menu :

A GtkMenu to set

app_indicator_set_icon ()

void                app_indicator_set_icon              (AppIndicator *self,
                                                         const gchar *icon_name);

Sets the default icon to use when the status is active but not set to attention. In most cases, this should be the application icon for the program. Wrapper function for property "icon-name".

self :

The AppIndicator object to use

icon_name :

The icon name to set.

app_indicator_set_icon_theme_path ()

void                app_indicator_set_icon_theme_path   (AppIndicator *self,
                                                         const gchar *icon_theme_path);

Sets the path to use when searching for icons.

self :

The AppIndicator object to use

icon_theme_path :

The icon theme path to set.

app_indicator_get_id ()

const gchar *       app_indicator_get_id                (AppIndicator *self);

Wrapper function for property "id".

self :

The AppIndicator object to use

Returns :

The current ID

app_indicator_get_category ()

AppIndicatorCategory  app_indicator_get_category        (AppIndicator *self);

Wrapper function for property "category".

self :

The AppIndicator object to use

Returns :

The current category.

app_indicator_get_status ()

AppIndicatorStatus  app_indicator_get_status            (AppIndicator *self);

Wrapper function for property "status".

self :

The AppIndicator object to use

Returns :

The current status.

app_indicator_get_icon ()

const gchar *       app_indicator_get_icon              (AppIndicator *self);

Wrapper function for property "icon-name".

self :

The AppIndicator object to use

Returns :

The current icon name.

app_indicator_get_icon_theme_path ()

const gchar *       app_indicator_get_icon_theme_path   (AppIndicator *self);

Wrapper function for property "icon-theme-path".

self :

The AppIndicator object to use

Returns :

The current icon theme path.

app_indicator_get_attention_icon ()

const gchar *       app_indicator_get_attention_icon    (AppIndicator *self);

Wrapper function for property "attention-icon-name".

self :

The AppIndicator object to use

Returns :

The current attention icon name.

app_indicator_get_menu ()

GtkMenu *           app_indicator_get_menu              (AppIndicator *self);

Gets the menu being used for this application indicator. Wrapper function for property "menu".

self :

The AppIndicator object to use

Returns :

A GtkMenu object or NULL if one hasn't been set.

Property Details

The "attention-icon-name" property

  "attention-icon-name"      gchar*                : Read / Write

If the indicator sets it's status to APP_INDICATOR_STATUS_ATTENTION then this icon is shown.

Default value: NULL


The "category" property

  "category"                 gchar*                : Read / Write / Construct Only

The type of indicator that this represents. Please don't use 'Other'. Defaults to 'ApplicationStatus'.

Default value: NULL


The "connected" property

  "connected"                gboolean              : Read

Pretty simple, TRUE if we have a reasonable expectation of being displayed through this object. You should hide your TrayIcon if so.

Default value: FALSE


The "icon-name" property

  "icon-name"                gchar*                : Read / Write / Construct

The name of the regular icon that is shown for the indicator.

Default value: NULL


The "icon-theme-path" property

  "icon-theme-path"          gchar*                : Read / Write / Construct

An additional place to look for icon names that may be installed by the application.

Default value: NULL


The "id" property

  "id"                       gchar*                : Read / Write / Construct Only

The ID for this indicator, which should be unique, but used consistently by this program and its indicator.

Default value: NULL


The "menu" property

  "menu"                     DBusGObjectPath*      : Read

A method for getting the menu path as a string for DBus.


The "status" property

  "status"                   gchar*                : Read / Write

Whether the indicator is shown or requests attention. Defaults to 'Passive'.

Default value: NULL

Signal Details

The "connection-changed" signal

void                user_function                      (AppIndicator *arg0,
                                                        gboolean      arg1,
                                                        gpointer      user_data)      : Run Last

Signaled when we connect to a watcher, or when it drops away.

arg0 :

The AppIndicator object

arg1 :

Whether we're connected or not

user_data :

user data set when the signal handler was connected.

The "new-attention-icon" signal

void                user_function                      (AppIndicator *arg0,
                                                        gpointer      user_data)      : Run Last

Emitted when "attention-icon-name" is changed

arg0 :

The AppIndicator object

user_data :

user data set when the signal handler was connected.

The "new-icon" signal

void                user_function                      (AppIndicator *arg0,
                                                        gpointer      user_data)      : Run Last

Emitted when "icon-name" is changed

arg0 :

The AppIndicator object

user_data :

user data set when the signal handler was connected.

The "new-icon-theme-path" signal

void                user_function                      (AppIndicator *arg0,
                                                        gchar        *arg1,
                                                        gpointer      user_data)      : Run Last

Signaled when there is a new icon set for the object.

arg0 :

The AppIndicator object

user_data :

user data set when the signal handler was connected.

The "new-status" signal

void                user_function                      (AppIndicator *arg0,
                                                        gchar        *arg1,
                                                        gpointer      user_data)      : Run Last

Emitted when "status" is changed

arg0 :

The AppIndicator object

arg1 :

The string value of the AppIndicatorStatus enum.

user_data :

user data set when the signal handler was connected.