Back to index

indicator-appmenu  12.10.0
Classes | Typedefs | Functions | Variables
hudsettings.h File Reference
#include <glib.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _HudSettings

Typedefs

typedef struct _HudSettings

Functions

void hud_settings_init (void)
 hud_settings_init:

Variables

HudSettings hud_settings
 SECTION:hudsettings : HudSettings : tunable parameters.

Class Documentation

struct _HudSettings

Definition at line 26 of file hudsettings.h.

Class Members
guint add_penalty
guint drop_penalty
guint end_drop_penalty
guint indicator_penalty
guint max_distance
gboolean store_usage_data
guint swap_penalty

Typedef Documentation

typedef struct _HudSettings

Definition at line 24 of file hudsettings.h.


Function Documentation

void hud_settings_init ( void  )

hud_settings_init:

Initialises the #HudSettings using #GSettings and keeps it in sync.

If #GSettings indicates that the settings have changed, they will be updated.

Definition at line 117 of file hudsettings.c.

{
  GSettings *settings;

  settings = g_settings_new ("com.canonical.indicator.appmenu.hud");
  g_signal_connect (settings, "change-event", G_CALLBACK (hud_settings_refresh), NULL);
  hud_settings_refresh (settings);

  settings = g_settings_new ("com.canonical.indicator.appmenu.hud.search");
  g_signal_connect (settings, "change-event", G_CALLBACK (hud_search_settings_refresh), NULL);
  hud_search_settings_refresh (settings);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

HudSettings hud_settings

SECTION:hudsettings : HudSettings : tunable parameters.

HudSettings is a structure that contains the value of several

tunable parameters that affect the behaviour of various components of the HUD.

This structure exists for two reasons.

The first reason is that caching these values in local variables eliminates the need to look them up from #GSettings on each use. This vastly improves the performance of the matching algorithms (as many of these values are used quite a lot from within them).

The second reason is to improve testability. The testcases are able to hardcode sane values for the settings without worrying about changes that the user may have made to their local configuration (which could otherwise cause spurious test failures). HudSettings: : if usage tracking should be performed : the percentage by which to increase the distance of indicators when sorting the results list : the maximum distance value we consider as being a matching result : the penalty incurred by a character in the search term that does not exist in the item being matched : the penalty incurred by a character missing from the search string as compared to the item being matched : the penalty incurred by a character missing from the search string as compared to the item being matched when the character is at the end of the item (ie: the search term is a prefix of the item) : the penalty incurred for the substitution of one character for another

This structure contains the value of several tunable parameters that affect the behaviour of various components of the HUD. hud_settings:

The #HudSettings in effect.

hud_settings_init() can be used to keep these values in sync with

GSettings. For testing, it may make sense to set these values

directly.

Definition at line 78 of file hudsettings.c.