Back to index

indicator-appmenu  12.10.0
Classes | Typedefs | Functions
hudsourcelist.c File Reference
#include "hudsourcelist.h"

Go to the source code of this file.

Classes

struct  _HudSourceList
 SECTION:hudsourcelist : HudSourceList : a list of #HudSources that is itself a #HudSource. More...

Typedefs

typedef GObjectClass HudSourceListClass

Functions

static void hud_source_list_iface_init (HudSourceInterface *iface)
 G_DEFINE_TYPE_WITH_CODE (HudSourceList, hud_source_list, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(HUD_TYPE_SOURCE, hud_source_list_iface_init))
static void hud_source_list_use (HudSource *source)
static void hud_source_list_unuse (HudSource *source)
static void hud_source_list_search (HudSource *source, GPtrArray *results_array, HudTokenList *search_string)
static void hud_source_list_finalize (GObject *object)
static void hud_source_list_init (HudSourceList *list)
static void hud_source_list_class_init (HudSourceListClass *class)
HudSourceList * hud_source_list_new (void)
 hud_source_list_new:
void hud_source_list_add (HudSourceList *list, HudSource *source)
 hud_source_list_add: : a #HudSourceList : a #HudSource to add to the list

Class Documentation

struct _HudSourceList

SECTION:hudsourcelist : HudSourceList : a list of #HudSources that is itself a #HudSource.

HudSourceList is a list of #HudSources that functions as a

HudSource itself.

Calls to hud_source_search() on the list get turned into searches on each source in the list. If any source in the list emits the HudSource::changed signal then the list itself will emit it as well.

Sources may be added to the list using hud_source_list_add(). It is not possible to remove sources. HudSourceList:

This is an opaque structure type.

Definition at line 43 of file hudsourcelist.c.

Class Members
GSList * list
GObject parent_instance

Typedef Documentation

typedef GObjectClass HudSourceListClass

Definition at line 50 of file hudsourcelist.c.


Function Documentation

G_DEFINE_TYPE_WITH_CODE ( HudSourceList  ,
hud_source_list  ,
G_TYPE_OBJECT  ,
G_IMPLEMENT_INTERFACE(HUD_TYPE_SOURCE, hud_source_list_iface_init  
)

Definition at line 53 of file hudsourcelist.c.

{
  HudSourceList *list = user_data;

  hud_source_changed (HUD_SOURCE (list));
}

Here is the call graph for this function:

void hud_source_list_add ( HudSourceList *  list,
HudSource *  source 
)

hud_source_list_add: : a #HudSourceList : a #HudSource to add to the list

Adds to .

Future hud_source_search() calls on will include results from .

Definition at line 155 of file hudsourcelist.c.

{
  g_return_if_fail (HUD_IS_SOURCE_LIST (list));
  g_return_if_fail (HUD_IS_SOURCE (source));

  g_signal_connect_object (source, "changed", G_CALLBACK (hud_source_list_source_changed), list, 0);
  list->list = g_slist_prepend (list->list, g_object_ref (source));

  hud_source_changed (HUD_SOURCE (source));
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void hud_source_list_class_init ( HudSourceListClass class) [static]

Definition at line 123 of file hudsourcelist.c.

{
  class->finalize = hud_source_list_finalize;
}

Here is the call graph for this function:

static void hud_source_list_finalize ( GObject *  object) [static]

Definition at line 98 of file hudsourcelist.c.

{
  HudSourceList *list = HUD_SOURCE_LIST (object);

  /* signals have already been disconnected in dispose */
  g_slist_free_full (list->list, g_object_unref);

  G_OBJECT_CLASS (hud_source_list_parent_class)
    ->finalize (object);
}

Here is the caller graph for this function:

static void hud_source_list_iface_init ( HudSourceInterface *  iface) [static]

Definition at line 115 of file hudsourcelist.c.

{
  iface->use = hud_source_list_use;
  iface->unuse = hud_source_list_unuse;
  iface->search = hud_source_list_search;
}

Here is the call graph for this function:

static void hud_source_list_init ( HudSourceList *  list) [static]

Definition at line 110 of file hudsourcelist.c.

{
}
HudSourceList* hud_source_list_new ( void  )

hud_source_list_new:

Creates a #HudSourceList.

You should probably add some sources to it using hud_source_list_add().

Returns: a new empty #HudSourceList

Definition at line 139 of file hudsourcelist.c.

{
  return g_object_new (HUD_TYPE_SOURCE_LIST, NULL);
}

Here is the caller graph for this function:

static void hud_source_list_search ( HudSource *  source,
GPtrArray *  results_array,
HudTokenList *  search_string 
) [static]

Definition at line 86 of file hudsourcelist.c.

{
  HudSourceList *list = HUD_SOURCE_LIST (source);
  GSList *node;

  for (node = list->list; node; node = node->next)
    hud_source_search (node->data, results_array, search_string);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void hud_source_list_unuse ( HudSource *  source) [static]

Definition at line 76 of file hudsourcelist.c.

{
  HudSourceList *list = HUD_SOURCE_LIST (source);
  GSList *node;

  for (node = list->list; node; node = node->next)
    hud_source_unuse (node->data);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void hud_source_list_use ( HudSource *  source) [static]

Definition at line 66 of file hudsourcelist.c.

{
  HudSourceList *list = HUD_SOURCE_LIST (source);
  GSList *node;

  for (node = list->list; node; node = node->next)
    hud_source_use (node->data);
}

Here is the call graph for this function:

Here is the caller graph for this function: