Back to index

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

Go to the source code of this file.

Defines

#define G_TYPE_ACTION_MUXER   (g_action_muxer_get_type ())
#define G_ACTION_MUXER(inst)
#define G_IS_ACTION_MUXER(inst)

Typedefs

typedef struct _GActionMuxer

Functions

G_GNUC_INTERNAL GType g_action_muxer_get_type (void)
G_GNUC_INTERNAL GActionMuxer * g_action_muxer_new (void)
G_GNUC_INTERNAL void g_action_muxer_insert (GActionMuxer *muxer, const gchar *prefix, GActionGroup *group)
G_GNUC_INTERNAL void g_action_muxer_remove (GActionMuxer *muxer, const gchar *prefix)

Define Documentation

#define G_ACTION_MUXER (   inst)
Value:
(G_TYPE_CHECK_INSTANCE_CAST ((inst),                     \
                                                             G_TYPE_ACTION_MUXER, GActionMuxer))

Definition at line 28 of file gactionmuxer.h.

#define G_IS_ACTION_MUXER (   inst)
Value:
(G_TYPE_CHECK_INSTANCE_TYPE ((inst),                     \
                                                             G_TYPE_ACTION_MUXER))

Definition at line 30 of file gactionmuxer.h.

Definition at line 27 of file gactionmuxer.h.


Typedef Documentation

typedef struct _GActionMuxer

Definition at line 33 of file gactionmuxer.h.


Function Documentation

G_GNUC_INTERNAL GType g_action_muxer_get_type ( void  )
G_GNUC_INTERNAL void g_action_muxer_insert ( GActionMuxer *  muxer,
const gchar *  prefix,
GActionGroup *  group 
)

Definition at line 413 of file gactionmuxer.c.

{
  gchar **actions;
  Group *group;
  gint i;

  /* TODO: diff instead of ripout and replace */
  g_action_muxer_remove (muxer, prefix);

  group = g_slice_new (Group);
  group->muxer = muxer;
  group->group = g_object_ref (action_group);
  group->prefix = g_strdup (prefix);

  g_hash_table_insert (muxer->groups, group->prefix, group);

  actions = g_action_group_list_actions (group->group);
  for (i = 0; actions[i]; i++)
    g_action_muxer_action_added (group->group, actions[i], group);
  g_strfreev (actions);

  group->handler_ids[0] = g_signal_connect (group->group, "action-added",
                                            G_CALLBACK (g_action_muxer_action_added), group);
  group->handler_ids[1] = g_signal_connect (group->group, "action-removed",
                                            G_CALLBACK (g_action_muxer_action_removed), group);
  group->handler_ids[2] = g_signal_connect (group->group, "action-enabled-changed",
                                            G_CALLBACK (g_action_muxer_action_enabled_changed), group);
  group->handler_ids[3] = g_signal_connect (group->group, "action-state-changed",
                                            G_CALLBACK (g_action_muxer_action_state_changed), group);
}

Here is the call graph for this function:

Here is the caller graph for this function:

G_GNUC_INTERNAL GActionMuxer* g_action_muxer_new ( void  )

Definition at line 490 of file gactionmuxer.c.

{
  return g_object_new (G_TYPE_ACTION_MUXER, NULL);
}

Here is the caller graph for this function:

G_GNUC_INTERNAL void g_action_muxer_remove ( GActionMuxer *  muxer,
const gchar *  prefix 
)

Definition at line 457 of file gactionmuxer.c.

{
  Group *group;

  group = g_hash_table_lookup (muxer->groups, prefix);

  if (group != NULL)
    {
      gchar **actions;
      gint i;

      g_hash_table_steal (muxer->groups, prefix);

      actions = g_action_group_list_actions (group->group);
      for (i = 0; actions[i]; i++)
        g_action_muxer_action_removed (group->group, actions[i], group);
      g_strfreev (actions);

      /* 'for loop' or 'four loop'? */
      for (i = 0; i < 4; i++)
        g_signal_handler_disconnect (group->group, group->handler_ids[i]);

      g_action_muxer_free_group (group);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function: