Back to index

unity  6.0.0
Classes | Defines | Functions
panel-indicator-entry-accessible.c File Reference
#include "panel-indicator-entry-accessible.h"
#include "panel-service.h"

Go to the source code of this file.

Classes

struct  _PanelIndicatorEntryAccessiblePrivate

Defines

#define GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_INDICATOR_ENTRY_ACCESSIBLE, PanelIndicatorEntryAccessiblePrivate))

Functions

static void piea_component_interface_init (AtkComponentIface *iface)
static void panel_indicator_entry_accessible_initialize (AtkObject *accessible, gpointer data)
static gint panel_indicator_entry_accessible_get_n_children (AtkObject *accessible)
static AtkObject * panel_indicator_entry_accessible_ref_child (AtkObject *accessible, gint i)
static AtkStateSet * panel_indicator_entry_accessible_ref_state_set (AtkObject *accessible)
 G_DEFINE_TYPE_WITH_CODE (PanelIndicatorEntryAccessible, panel_indicator_entry_accessible, ATK_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT, piea_component_interface_init))
static void on_geometries_changed_cb (PanelService *service, IndicatorObject *object, IndicatorObjectEntry *entry, gint x, gint y, gint width, gint height, gpointer user_data)
static void panel_indicator_entry_accessible_finalize (GObject *object)
static void panel_indicator_entry_accessible_class_init (PanelIndicatorEntryAccessibleClass *klass)
static void panel_indicator_entry_accessible_init (PanelIndicatorEntryAccessible *piea)
AtkObject * panel_indicator_entry_accessible_new (IndicatorObjectEntry *entry)
IndicatorObjectEntry * panel_indicator_entry_accessible_get_entry (PanelIndicatorEntryAccessible *piea)
static void panel_indicator_entry_accessible_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type)

Class Documentation

struct _PanelIndicatorEntryAccessiblePrivate

Definition at line 30 of file panel-indicator-entry-accessible.c.

Class Members
gboolean active
IndicatorObjectEntry * entry
gint height
PanelService * service
gint width
gint x
gint y

Define Documentation

#define GET_PRIVATE (   o)    (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_INDICATOR_ENTRY_ACCESSIBLE, PanelIndicatorEntryAccessiblePrivate))

Function Documentation

G_DEFINE_TYPE_WITH_CODE ( PanelIndicatorEntryAccessible  ,
panel_indicator_entry_accessible  ,
ATK_TYPE_OBJECT  ,
G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT, piea_component_interface_init  
)

Definition at line 41 of file panel-indicator-entry-accessible.c.

{
  gchar *s;
  gboolean adding = FALSE;
  PanelIndicatorEntryAccessible *piea;

  g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (user_data));

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (user_data);

  /* The PanelService sends us a string containing the pointer to the IndicatorObjectEntry */
  s = g_strdup_printf ("%p", piea->priv->entry);
  if (g_str_equal (s, entry_id))
    {
      adding = TRUE;
      piea->priv->active = TRUE;
    }
  else
    {
      piea->priv->active = FALSE;
    }

  /* Notify AT's about the states' changes */
  atk_object_notify_state_change (ATK_OBJECT (piea), ATK_STATE_ACTIVE, adding);
  atk_object_notify_state_change (ATK_OBJECT (piea), ATK_STATE_FOCUSED, adding);
  atk_object_notify_state_change (ATK_OBJECT (piea), ATK_STATE_SHOWING, adding);

  g_free (s);
}
static void on_geometries_changed_cb ( PanelService *  service,
IndicatorObject *  object,
IndicatorObjectEntry *  entry,
gint  x,
gint  y,
gint  width,
gint  height,
gpointer  user_data 
) [static]

Definition at line 81 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;
  AtkRectangle rect;

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (user_data);

  g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (piea));

  if (entry != piea->priv->entry)
    return;

  piea->priv->x = x;
  piea->priv->y = y;
  piea->priv->width = width;
  piea->priv->height = height;

  /* Notify ATK objects of change of coordinates */
  rect.x = piea->priv->x;
  rect.y = piea->priv->y;
  rect.width = piea->priv->width;
  rect.height = piea->priv->height;
  g_signal_emit_by_name (ATK_COMPONENT (piea), "bounds-changed", &rect);
}

Here is the caller graph for this function:

static void panel_indicator_entry_accessible_class_init ( PanelIndicatorEntryAccessibleClass *  klass) [static]

Definition at line 132 of file panel-indicator-entry-accessible.c.

{
  GObjectClass *object_class;
  AtkObjectClass *atk_class;

  /* GObject */
  object_class = G_OBJECT_CLASS (klass);
  object_class->finalize = panel_indicator_entry_accessible_finalize;

  /* AtkObject */
  atk_class = ATK_OBJECT_CLASS (klass);
  atk_class->initialize = panel_indicator_entry_accessible_initialize;
  atk_class->get_n_children = panel_indicator_entry_accessible_get_n_children;
  atk_class->ref_child = panel_indicator_entry_accessible_ref_child;
  atk_class->ref_state_set = panel_indicator_entry_accessible_ref_state_set;

  g_type_class_add_private (object_class, sizeof (PanelIndicatorEntryAccessiblePrivate));
}

Here is the call graph for this function:

static void panel_indicator_entry_accessible_finalize ( GObject *  object) [static]

Definition at line 114 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;

  g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (object));

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (object);

  if (piea->priv != NULL)
    {
      g_signal_handlers_disconnect_by_func (piea->priv->service, on_entry_activated_cb, piea);
      g_signal_handlers_disconnect_by_func (piea->priv->service, on_geometries_changed_cb, piea);
    }

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

Here is the call graph for this function:

Here is the caller graph for this function:

IndicatorObjectEntry* panel_indicator_entry_accessible_get_entry ( PanelIndicatorEntryAccessible *  piea)

Definition at line 178 of file panel-indicator-entry-accessible.c.

{
  g_return_val_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (piea), NULL);

  return piea->priv->entry;
}

Here is the caller graph for this function:

static void panel_indicator_entry_accessible_get_extents ( AtkComponent *  component,
gint *  x,
gint *  y,
gint *  width,
gint *  height,
AtkCoordType  coord_type 
) [static]

Definition at line 188 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;

  g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (component));

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (component);

  /* We ignore AtkCoordType for now, as the panel is always at the top left
     corner and so relative and absolute coordinates are the same */
  *x = piea->priv->x;
  *y = piea->priv->y;
  *width = piea->priv->width;
  *height = piea->priv->height;
}

Here is the caller graph for this function:

static gint panel_indicator_entry_accessible_get_n_children ( AtkObject *  accessible) [static]

Definition at line 247 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;
  gint n_children = 0;

  g_return_val_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (accessible), 0);

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);

  if (piea->priv->entry->parent_object && GTK_IS_MENU (piea->priv->entry->menu))
    n_children = 1;

  return n_children;
}

Here is the caller graph for this function:

static void panel_indicator_entry_accessible_init ( PanelIndicatorEntryAccessible *  piea) [static]

Definition at line 152 of file panel-indicator-entry-accessible.c.

{
  piea->priv = GET_PRIVATE (piea);
  piea->priv->x = piea->priv->y = piea->priv->width = piea->priv->height = 0;

  /* Set up signals for listening to service changes */
  piea->priv->active = FALSE;
  piea->priv->service = panel_service_get_default ();
  g_signal_connect (piea->priv->service, "geometries-changed",
                  G_CALLBACK (on_geometries_changed_cb), piea);
  g_signal_connect (piea->priv->service, "entry-activated",
                  G_CALLBACK (on_entry_activated_cb), piea);
}

Here is the call graph for this function:

static void panel_indicator_entry_accessible_initialize ( AtkObject *  accessible,
gpointer  data 
) [static]

Definition at line 218 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;

  g_return_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (accessible));

  ATK_OBJECT_CLASS (panel_indicator_entry_accessible_parent_class)->initialize (accessible, data);

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);
  piea->priv->entry = (IndicatorObjectEntry *) data;

  if (GTK_IS_LABEL (piea->priv->entry->label))
    {
      atk_object_set_role (accessible, ATK_ROLE_LABEL);
      atk_object_set_name (accessible,
                        gtk_label_get_text (piea->priv->entry->label));
    }
  if (GTK_IS_IMAGE (piea->priv->entry->image))
    {
      atk_object_set_role (accessible, ATK_ROLE_IMAGE);
      if (piea->priv->entry->accessible_desc != NULL)
        atk_object_set_name (accessible, piea->priv->entry->accessible_desc);
    }

  if (piea->priv->entry->accessible_desc != NULL)
    atk_object_set_description (accessible, piea->priv->entry->accessible_desc);
}

Here is the caller graph for this function:

AtkObject* panel_indicator_entry_accessible_new ( IndicatorObjectEntry *  entry)

Definition at line 167 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;

  piea = g_object_new (PANEL_TYPE_INDICATOR_ENTRY_ACCESSIBLE, NULL);
  atk_object_initialize (ATK_OBJECT (piea), entry);

  return ATK_OBJECT (piea);
}

Here is the caller graph for this function:

static AtkObject * panel_indicator_entry_accessible_ref_child ( AtkObject *  accessible,
gint  i 
) [static]

Definition at line 263 of file panel-indicator-entry-accessible.c.

{
  PanelIndicatorEntryAccessible *piea;
  AtkObject *child = NULL;

  g_return_val_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (accessible), NULL);

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);
  if (piea->priv->entry->parent_object && GTK_IS_MENU (piea->priv->entry->menu))
    {
      child = gtk_widget_get_accessible (GTK_WIDGET (piea->priv->entry->menu));
      atk_object_set_parent (child, accessible);
    }

  if (child != NULL)
    return g_object_ref (child);
  else
    return NULL;
}

Here is the caller graph for this function:

static AtkStateSet * panel_indicator_entry_accessible_ref_state_set ( AtkObject *  accessible) [static]

Definition at line 284 of file panel-indicator-entry-accessible.c.

{
  AtkStateSet *state_set;
  PanelIndicatorEntryAccessible *piea;

  g_return_val_if_fail (PANEL_IS_INDICATOR_ENTRY_ACCESSIBLE (accessible), NULL);

  piea = PANEL_INDICATOR_ENTRY_ACCESSIBLE (accessible);

  /* Retrieve state_set from parent_class */
  state_set = ATK_OBJECT_CLASS (panel_indicator_entry_accessible_parent_class)->ref_state_set (accessible);

  atk_state_set_add_state (state_set, ATK_STATE_ENABLED);
  atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
  atk_state_set_add_state (state_set, ATK_STATE_HORIZONTAL);
  atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
  atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);

  if (piea->priv->active)
    {
      atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
      atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
      atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
    }

  return state_set;
}

Here is the caller graph for this function:

static void piea_component_interface_init ( AtkComponentIface *  iface) [static]

Definition at line 210 of file panel-indicator-entry-accessible.c.

{
  g_return_if_fail (iface != NULL);

  iface->get_extents = panel_indicator_entry_accessible_get_extents;
}

Here is the call graph for this function: