HudManager

HudManager — Manage data exported to HUD for the application

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <libhud/manager.h>

#define             HUD_MANAGER_PROP_APPLICATION
#define             HUD_MANAGER_PROP_APP_ID
struct              HudManagerClass;
HudManager *        hud_manager_new                     (const gchar *application_id);
HudManager *        hud_manager_new_for_application     (GApplication *application);
void                hud_manager_add_actions             (HudManager *manager,
                                                         HudActionPublisher *pub);
void                hud_manager_remove_actions          (HudManager *manager,
                                                         HudActionPublisher *pub);
void                hud_manager_switch_window_context   (HudManager *manager,
                                                         HudActionPublisher *pub);

Description

Applications that are exporting data to the HUD can export data for every window or context in the application. This includes application internal structures like tabs or views on the various data inside the application. The HUD manager allows for registering and managing all the actions that are exported to the HUD for the application.

Details

HUD_MANAGER_PROP_APPLICATION

#define HUD_MANAGER_PROP_APPLICATION  "application"

Define for the string to lookup HudManager:application.


HUD_MANAGER_PROP_APP_ID

#define HUD_MANAGER_PROP_APP_ID       "app-id"

Define for the string to lookup HudManager:app-id.


struct HudManagerClass

struct HudManagerClass {
	GObjectClass parent_class;
};

Class data for HudManager

GObjectClass parent_class;

The GObject class

hud_manager_new ()

HudManager *        hud_manager_new                     (const gchar *application_id);

Creates a new HudManager object.

application_id :

Unique identifier of the application, usually desktop file name

Returns :

New HudManager. [transfer full]

hud_manager_new_for_application ()

HudManager *        hud_manager_new_for_application     (GApplication *application);

Creates a new HudManager object using the application ID in th application object. Also exports the default actions there in the "app" namespace.

application :

GApplication that we can use to get the ID and some actions from

Returns :

New HudManager. [transfer full]

hud_manager_add_actions ()

void                hud_manager_add_actions             (HudManager *manager,
                                                         HudActionPublisher *pub);

Sets up a set of actions and descriptions for a specific user context. This could be a window or a tab, depending on how the application works.

manager :

A HudManager object

pub :

Action publisher object tracking the descriptions and action groups

hud_manager_remove_actions ()

void                hud_manager_remove_actions          (HudManager *manager,
                                                         HudActionPublisher *pub);

Removes actions for being watched by the HUD. Should be done when the object is remove. Does not require pub to be a valid object so it can be used with weak pointer style destroy.

manager :

A HudManager object

pub :

Action publisher object tracking the descriptions and action groups

hud_manager_switch_window_context ()

void                hud_manager_switch_window_context   (HudManager *manager,
                                                         HudActionPublisher *pub);

Tells the HUD service that a window should use a different context of actions with the current window. This allows the application to export sets of actions and switch them easily with a single dbus message.

manager :

A HudManager object

pub :

Action publisher object tracking the descriptions and action groups