Ejemplo n.º 1
0
/**
 * @brief Get state set of accessible object
 *
 * @param obj object instance
 *
 * @returns referred AtkStateSet object
 */
static AtkStateSet *
eail_naviframe_page_ref_state_set(AtkObject *obj)
{
   EailNaviframePage *page;
   AtkStateSet *state_set;
   Evas_Object *widget;

   g_return_val_if_fail(EAIL_IS_NAVIFRAME_PAGE(obj), NULL);

   page = EAIL_NAVIFRAME_PAGE(obj);
   if (!page->naviframe) return NULL;

   widget = elm_object_part_content_get(page->naviframe, "default");

   state_set = atk_state_set_new();

   /* only item-page on top is visible*/
   if (elm_naviframe_top_item_get(page->naviframe) == page->page)
     {
        atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
        atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
     }

   if (!elm_object_disabled_get(widget))
     atk_state_set_add_state(state_set, ATK_STATE_ENABLED);

   return state_set;
}
Ejemplo n.º 2
0
static void
jaw_object_init (JawObject *object)
{
	AtkObject *atk_obj = ATK_OBJECT(object);
	atk_obj->description = NULL;

	object->state_set = atk_state_set_new();
}
Ejemplo n.º 3
0
JNIEXPORT jint JNICALL ATK_NATIVE(_1atk_1state_1set_1new)
	(JNIEnv *env, jclass that)
{
	jint rc = 0;
	ATK_NATIVE_ENTER(env, that, _1atk_1state_1set_1new_FUNC);
	rc = (jint)atk_state_set_new();
	ATK_NATIVE_EXIT(env, that, _1atk_1state_1set_1new_FUNC);
	return rc;
}
Ejemplo n.º 4
0
/**
 * Initializes the PyAtkStateSet members, such as the AtkStateSet.
 */
static int
_atkstateset_init (PyAtkStateSet *self, PyObject *args, PyObject *kwds)
{
    debug ("_atkstateset_init\n");

    if (!self->obj)
        self->obj = atk_state_set_new ();
    return 0;
}
static void
gucharmap_chartable_cell_accessible_init (GucharmapChartableCellAccessible *cell)
{
  cell->state_set = atk_state_set_new ();
  cell->widget = NULL;
  cell->index = 0;
  cell->action_idle_handler = 0;
  atk_state_set_add_state (cell->state_set, ATK_STATE_TRANSIENT);
  atk_state_set_add_state (cell->state_set, ATK_STATE_ENABLED);
}
Ejemplo n.º 6
0
static void
_gtk_icon_view_item_accessible_init (GtkIconViewItemAccessible *item)
{
  item->state_set = atk_state_set_new ();

  atk_state_set_add_state (item->state_set, ATK_STATE_ENABLED);
  atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSABLE);
  atk_state_set_add_state (item->state_set, ATK_STATE_SENSITIVE);
  atk_state_set_add_state (item->state_set, ATK_STATE_SELECTABLE);
  atk_state_set_add_state (item->state_set, ATK_STATE_VISIBLE);

  item->action_description = NULL;
  item->image_description = NULL;

  item->action_idle_handler = 0;
}
Ejemplo n.º 7
0
static AtkStateSet *
gtk_cell_accessible_ref_state_set (AtkObject *accessible)
{
  GtkCellAccessible *cell_accessible;
  AtkStateSet *state_set;
  GtkCellRendererState flags;
  guint i;

  cell_accessible = GTK_CELL_ACCESSIBLE (accessible);

  state_set = atk_state_set_new ();

  if (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell_accessible)) == NULL)
    {
      atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT);
      return state_set;
    }

  flags = _gtk_cell_accessible_get_state (cell_accessible);

  atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
  atk_state_set_add_state (state_set, ATK_STATE_SELECTABLE);
  atk_state_set_add_state (state_set, ATK_STATE_TRANSIENT);
  atk_state_set_add_state (state_set, ATK_STATE_VISIBLE);

  for (i = 0; i < G_N_ELEMENTS (state_map); i++)
    {
      if (flags & state_map[i].renderer_state)
        {
          if (!state_map[i].invert)
            atk_state_set_add_state (state_set, state_map[i].atk_state);
        }
      else
        {
          if (state_map[i].invert)
            atk_state_set_add_state (state_set, state_map[i].atk_state);
        }
    }

  if (gtk_widget_get_mapped (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell_accessible))))
    atk_state_set_add_state (state_set, ATK_STATE_SHOWING);

  return state_set;
}
AtkStateSet *
spi_state_set_cache_from_sequence (const GArray *seq)
{
  int i;
  AtkStateSet *set;
  AtkStateType *states;

  spi_init_state_type_tables ();
  
  states = g_newa (AtkStateType, seq->len);
  for (i = 0; i < seq->len; i++)
    states [i] = state_spi_to_atk (g_array_index (seq, dbus_int32_t, i));

  set = atk_state_set_new ();
  atk_state_set_add_states (set, states, seq->len);

  g_array_free (seq, TRUE);
  return set;
}
Ejemplo n.º 9
0
static VALUE
rg_initialize(VALUE self)
{
    G_INITIALIZE(self, atk_state_set_new());
    return Qnil;
}
Ejemplo n.º 10
0
static gboolean
test_state_set (void)
{
  AtkStateSet *state_set1, *state_set2, *state_set3;
  AtkStateType state_array[3];
  gboolean b_val;

  state_set1 = atk_state_set_new ();

  b_val = atk_state_set_is_empty (state_set1);  
  if (b_val)
  {
    g_print ("New state set is not empty\n");
    return FALSE;
  }

  b_val = atk_state_set_add_state (state_set1, ATK_STATE_ACTIVE);
  if (!b_val)
  {
    g_print ("Adding new state set failed\n");
    return FALSE;
  }

  b_val = atk_state_set_is_empty (state_set1);  
  if (!b_val)
  {
    g_print ("New state set is empty when it should not be\n");
    return FALSE;
  }

  b_val = atk_state_set_add_state (state_set1, ATK_STATE_ACTIVE);
  if (b_val)
  {
    g_print ("Adding new state set succeeded when it should not have\n");
    return FALSE;
  }

  state_array[0] = ATK_STATE_ACTIVE;
  state_array[1] = ATK_STATE_VISIBLE;
  state_array[2] = ATK_STATE_BUSY;
  atk_state_set_add_states (state_set1, state_array, 3);

  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_ACTIVE);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_ACTIVE but should not have\n");
    return FALSE;
  }
 
  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_VISIBLE);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_VISIBLE but should not have\n");
    return FALSE;
  }
 
  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_BUSY);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_BUSY but should not have\n");
    return FALSE;
  }
 
  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_VERTICAL);
  if (b_val)
  {
    g_print ("Contains state succeeded for ATK_STATE_VERTICAL but should not have\n");
    return FALSE;
  }
 
  atk_state_set_remove_state (state_set1, ATK_STATE_BUSY);
  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_BUSY);
  if (b_val)
  {
    g_print ("Contains state succeeded for ATK_STATE_BUSY but should not have\n");
    return FALSE;
  }
  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_VISIBLE);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_VISIBLE but should not have\n");
    return FALSE;
  }

  b_val = atk_state_set_contains_states (state_set1, state_array, 3);
  if (b_val)
  {
    g_print ("Contains states succeeded should not have\n");
    return FALSE;
  }

  b_val = atk_state_set_contains_states (state_set1, state_array, 2);
  if (!b_val)
  {
    g_print ("Contains states failed should not have\n");
    return FALSE;
  }

  state_array[0] = ATK_STATE_SINGLE_LINE;
  state_array[1] = ATK_STATE_VISIBLE;
  state_array[2] = ATK_STATE_VERTICAL;
 
  state_set2 = atk_state_set_new();
  atk_state_set_add_states (state_set2, state_array, 3);

  state_set3 = atk_state_set_and_sets (state_set1, state_set2);
  b_val = atk_state_set_contains_state (state_set3, ATK_STATE_VISIBLE);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_VISIBLE after and but should not have\n");
    return FALSE;
  }
  b_val = atk_state_set_contains_state (state_set3, ATK_STATE_BUSY);
  if (b_val)
  {
    g_print ("Contains state succeeded for ATK_STATE_BUSY after and but should not have\n");
    return FALSE;
  }
  g_object_unref (state_set3);

  atk_state_set_remove_state (state_set1, ATK_STATE_VISIBLE);
  state_set3 = atk_state_set_and_sets (state_set1, state_set2);
  if (state_set3)
  {
    g_print ("state_set 3 is not NULL after and but should be\n");
    return FALSE;
  }
 
  state_set3 = atk_state_set_or_sets (state_set1, state_set2);
  b_val = atk_state_set_contains_state (state_set3, ATK_STATE_VISIBLE);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_VISIBLE after or but should not have\n");
    return FALSE;
  }

  b_val = atk_state_set_contains_state (state_set3, ATK_STATE_INVALID);
  if (b_val)
  {
    g_print ("Contains state succeeded for ATK_STATE_INVALID after or but should not have\n");
    return FALSE;
  }
  g_object_unref (state_set3);

  b_val = atk_state_set_add_state (state_set1, ATK_STATE_VISIBLE);
  if (!b_val)
  {
    g_print ("Adding new state set failed\n");
    return FALSE;
  }
  state_set3 = atk_state_set_xor_sets (state_set1, state_set2);
  b_val = atk_state_set_contains_state (state_set3, ATK_STATE_VISIBLE);
  if (b_val)
  {
    g_print ("Contains state succeeded for ATK_STATE_VISIBLE after xor but should not have\n");
    return FALSE;
  }

  b_val = atk_state_set_contains_state (state_set3, ATK_STATE_ACTIVE);
  if (!b_val)
  {
    g_print ("Contains state failed for ATK_STATE_ACTIVE after xor but should not have\n");
    return FALSE;
  }

  atk_state_set_clear_states (state_set1);
  b_val = atk_state_set_contains_state (state_set1, ATK_STATE_ACTIVE);
  if (b_val)
  {
    g_print ("Contains state succeeded for ATK_STATE_ACTIVE but should not have\n");
    return FALSE;
  }

  g_object_unref (state_set1);
  g_object_unref (state_set2);
  g_object_unref (state_set3);
  return TRUE;

}