Back to index

indicator-appmenu  12.10.0
Defines | Typedefs | Functions
huddbusmenucollector.h File Reference
#include <libbamf/libbamf.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HUD_TYPE_DBUSMENU_COLLECTOR   (hud_dbusmenu_collector_get_type ())
#define HUD_DBUSMENU_COLLECTOR(inst)
#define HUD_IS_DBUSMENU_COLLECTOR(inst)

Typedefs

typedef struct _HudDbusmenuCollector

Functions

GType hud_dbusmenu_collector_get_type (void)
HudDbusmenuCollector * hud_dbusmenu_collector_new_for_endpoint (const gchar *application_id, const gchar *prefix, const gchar *icon, guint penalty, const gchar *bus_name, const gchar *object_path)
 hud_dbusmenu_collector_new_for_endpoint: : a unique identifier for the application : the title to prefix to all items : the icon for the appliction : the penalty to apply to all results : a D-Bus bus name : an object path at the destination given by
HudDbusmenuCollector * hud_dbusmenu_collector_new_for_window (BamfWindow *window, const gchar *desktop_file, const gchar *icon)
 hud_dbusmenu_collector_new_for_window: : a #BamfWindow
void hud_dbusmenu_collector_set_prefix (HudDbusmenuCollector *collector, const gchar *prefix)
 hud_dbusmenu_collector_set_prefix: : a #HudDbusmenuCollector : the new prefix to use
void hud_dbusmenu_collector_set_icon (HudDbusmenuCollector *collector, const gchar *icon)
 hud_dbusmenu_collector_set_icon: : a #HudDbusmenuCollector : the application icon

Define Documentation

#define HUD_DBUSMENU_COLLECTOR (   inst)
Value:
(G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
                                                             HUD_TYPE_DBUSMENU_COLLECTOR, HudDbusmenuCollector))

Definition at line 25 of file huddbusmenucollector.h.

#define HUD_IS_DBUSMENU_COLLECTOR (   inst)
Value:
(G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
                                                             HUD_TYPE_DBUSMENU_COLLECTOR))

Definition at line 27 of file huddbusmenucollector.h.

Definition at line 24 of file huddbusmenucollector.h.


Typedef Documentation

typedef struct _HudDbusmenuCollector

Definition at line 30 of file huddbusmenucollector.h.


Function Documentation

HudDbusmenuCollector* hud_dbusmenu_collector_new_for_endpoint ( const gchar *  application_id,
const gchar *  prefix,
const gchar *  icon,
guint  penalty,
const gchar *  bus_name,
const gchar *  object_path 
)

hud_dbusmenu_collector_new_for_endpoint: : a unique identifier for the application : the title to prefix to all items : the icon for the appliction : the penalty to apply to all results : a D-Bus bus name : an object path at the destination given by

Creates a new #HudDbusmenuCollector for the specified endpoint.

Internally, a #DbusmenuClient is created for this endpoint. Searches are performed against the contents of those menus.

This call is intended to be used for indicators.

If is non-NULL (which, for indicators, it ought to be), then it is prefixed to every item created by the collector.

If is non-zero then all results returned from the collector have their distance increased by a percentage equal to the penalty. This allows items from indicators to score lower than they would otherwise.

Returns: a new #HudDbusmenuCollector

Definition at line 590 of file huddbusmenucollector.c.

{
  HudDbusmenuCollector *collector;

  collector = g_object_new (HUD_TYPE_DBUSMENU_COLLECTOR, NULL);
  collector->application_id = g_strdup (application_id);
  collector->icon = g_strdup (icon);
  if (prefix)
    collector->prefix = hud_string_list_cons (prefix, NULL);
  collector->penalty = penalty;
  hud_dbusmenu_collector_setup_endpoint (collector, bus_name, object_path);

  collector->alive = TRUE;

  return collector;
}

Here is the call graph for this function:

Here is the caller graph for this function:

HudDbusmenuCollector* hud_dbusmenu_collector_new_for_window ( BamfWindow *  window,
const gchar *  desktop_file,
const gchar *  icon 
)

hud_dbusmenu_collector_new_for_window: : a #BamfWindow

Creates a new #HudDbusmenuCollector for the endpoint indicated by the

HudAppMenuRegistrar for .

This call is intended to be used for application menus.

Returns: a new #HudDbusmenuCollector

Definition at line 624 of file huddbusmenucollector.c.

{
  HudDbusmenuCollector *collector;

  collector = g_object_new (HUD_TYPE_DBUSMENU_COLLECTOR, NULL);
  collector->application_id = g_strdup (desktop_file);
  collector->icon = g_strdup (icon);
  collector->xid = bamf_window_get_xid (window);
  g_debug ("dbusmenu on %d", collector->xid);
  hud_app_menu_registrar_add_observer (hud_app_menu_registrar_get (), collector->xid,
                                       hud_dbusmenu_collector_registrar_observer_func, collector);

  collector->alive = TRUE;

  return collector;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hud_dbusmenu_collector_set_icon ( HudDbusmenuCollector *  collector,
const gchar *  icon 
)

hud_dbusmenu_collector_set_icon: : a #HudDbusmenuCollector : the application icon

Changes the application icon used for all items of the collector.

This will involve destroying all of the items and recreating them (since each item's icon has to be changed).

Definition at line 673 of file huddbusmenucollector.c.

{
  g_free (collector->icon);
  collector->icon = g_strdup (icon);
  hud_dbusmenu_collector_setup_root (collector, collector->root);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void hud_dbusmenu_collector_set_prefix ( HudDbusmenuCollector *  collector,
const gchar *  prefix 
)

hud_dbusmenu_collector_set_prefix: : a #HudDbusmenuCollector : the new prefix to use

Changes the prefix applied to all items of the collector.

This will involve destroying all of the items and recreating them (since each item's prefix has to be changed).

Definition at line 654 of file huddbusmenucollector.c.

{
  hud_string_list_unref (collector->prefix);
  collector->prefix = hud_string_list_cons (prefix, NULL);
  hud_dbusmenu_collector_setup_root (collector, collector->root);
}

Here is the call graph for this function:

Here is the caller graph for this function: