Exemple #1
0
int
clip_GTK_COMBOBOXGETPOPUPACCESSIBLE(ClipMachine * ClipMachineMemory)
{
   C_widget *ccmb = _fetch_cw_arg(ClipMachineMemory);

   AtkObject *atk;

   C_object *catk;

   CHECKCWID(ccmb, GTK_IS_COMBO_BOX);

   atk = gtk_combo_box_get_popup_accessible(GTK_COMBO_BOX(ccmb->widget));

   if (atk)
    {
       catk = _list_get_cobject(ClipMachineMemory, atk);
       if (!catk)
	  catk = _register_object(ClipMachineMemory, atk, GTK_TYPE_OBJECT, NULL, NULL);
       if (catk)
	  _clip_mclone(ClipMachineMemory, RETPTR(ClipMachineMemory), &catk->obj);
    }

   return 0;
 err:
   return 1;
}
Exemple #2
0
static void
gtk_combo_box_accessible_initialize (AtkObject *obj,
                                     gpointer   data)
{
    GtkComboBox *combo_box;
    GtkComboBoxAccessible *accessible;
    AtkObject *popup;

    ATK_OBJECT_CLASS (_gtk_combo_box_accessible_parent_class)->initialize (obj, data);

    combo_box = GTK_COMBO_BOX (data);
    accessible = GTK_COMBO_BOX_ACCESSIBLE (obj);

    g_signal_connect (combo_box, "changed", G_CALLBACK (changed_cb), NULL);
    accessible->old_selection = gtk_combo_box_get_active (combo_box);

    popup = gtk_combo_box_get_popup_accessible (combo_box);
    if (popup)
    {
        atk_object_set_parent (popup, obj);
        accessible->popup_set = TRUE;
    }
    if (gtk_combo_box_get_has_entry (combo_box))
        atk_object_set_parent (gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (combo_box))), obj);

    obj->role = ATK_ROLE_COMBO_BOX;
}
Exemple #3
0
static AtkObject *
gtk_combo_box_accessible_ref_child (AtkObject *obj,
                                    gint       i)
{
    GtkWidget *widget;
    AtkObject *child;
    GtkComboBoxAccessible *box;

    widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
    if (widget == NULL)
        return NULL;

    if (i == 0)
    {
        child = gtk_combo_box_get_popup_accessible (GTK_COMBO_BOX (widget));
        box = GTK_COMBO_BOX_ACCESSIBLE (obj);
        if (box->popup_set == FALSE)
        {
            atk_object_set_parent (child, obj);
            box->popup_set = TRUE;
        }
    }
    else if (i == 1 && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget)))
    {
        child = gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (widget)));
    }
    else
    {
        return NULL;
    }

    return g_object_ref (child);
}
Exemple #4
0
static void
gail_combo_box_real_initialize (AtkObject *obj,
                                gpointer  data)
{
  GtkComboBox *combo_box;
  GailComboBox *gail_combo_box;
  AtkObject *popup;

  ATK_OBJECT_CLASS (gail_combo_box_parent_class)->initialize (obj, data);

  combo_box = GTK_COMBO_BOX (data);

  gail_combo_box = GAIL_COMBO_BOX (obj);

  g_signal_connect (combo_box,
                    "changed",
                    G_CALLBACK (gail_combo_box_changed_gtk),
                    NULL);
  gail_combo_box->old_selection = gtk_combo_box_get_active (combo_box);

  popup = gtk_combo_box_get_popup_accessible (combo_box);
  if (popup)
    {
      atk_object_set_parent (popup, obj);
      gail_combo_box->popup_set = TRUE;
    }
  if (GTK_IS_COMBO_BOX_ENTRY (combo_box))
    atk_object_set_parent (gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (combo_box))), obj);

  obj->role = ATK_ROLE_COMBO_BOX;
}
Exemple #5
0
static AtkObject*
gail_combo_box_ref_selection (AtkSelection *selection,
                              gint         i)
{
  GtkComboBox *combo_box;
  GtkWidget *widget;
  AtkObject *obj;
  gint index;

  widget = GTK_ACCESSIBLE (selection)->widget;
  if (widget == NULL)
    /*
     * State is defunct
     */
    return NULL;

  combo_box = GTK_COMBO_BOX (widget);

  /*
   * A combo_box box can have only one selection.
   */
  if (i != 0)
    return NULL;

  obj = gtk_combo_box_get_popup_accessible (combo_box);
  index = gtk_combo_box_get_active (combo_box);
  return atk_object_ref_accessible_child (obj, index);
}
Exemple #6
0
static gboolean
idle_do_action (gpointer data)
{
  GtkComboBox *combo_box;
  GtkWidget *widget;
  GailComboBox *gail_combo_box;
  AtkObject *popup;
  gboolean do_popup;

  gail_combo_box = GAIL_COMBO_BOX (data);
  gail_combo_box->action_idle_handler = 0;
  widget = GTK_ACCESSIBLE (gail_combo_box)->widget;
  if (widget == NULL || /* State is defunct */
      !gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget))
    return FALSE;

  combo_box = GTK_COMBO_BOX (widget);

  popup = gtk_combo_box_get_popup_accessible (combo_box);
  do_popup = !gtk_widget_get_mapped (GTK_ACCESSIBLE (popup)->widget);
  if (do_popup)
      gtk_combo_box_popup (combo_box);
  else
      gtk_combo_box_popdown (combo_box);

  return FALSE;
}
Exemple #7
0
static AtkObject*
gail_combo_box_ref_child (AtkObject *obj,
                          gint      i)
{
  GtkWidget *widget;
  AtkObject *child;
  GailComboBox *box;

  g_return_val_if_fail (GAIL_IS_COMBO_BOX (obj), NULL);

  widget = GTK_ACCESSIBLE (obj)->widget;

  if (widget == NULL)
    /*
     * State is defunct
     */
    return NULL;

  if (i == 0)
    {
      child = gtk_combo_box_get_popup_accessible (GTK_COMBO_BOX (widget));
      box = GAIL_COMBO_BOX (obj);
      if (box->popup_set == FALSE)
        {
          atk_object_set_parent (child, obj);
          box->popup_set = TRUE;
        }
    }
  else if (i == 1 && GTK_IS_COMBO_BOX_ENTRY (widget))
    {
      child = gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (widget)));
    }
  else
    {
      return NULL;
    }
  return g_object_ref (child);
}
Exemple #8
0
static AtkObject *
gtk_combo_box_accessible_ref_selection (AtkSelection *selection,
                                        gint          i)
{
    GtkComboBox *combo_box;
    GtkWidget *widget;
    AtkObject *obj;
    gint index;

    widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
    if (widget == NULL)
        return NULL;

    if (i != 0)
        return NULL;

    combo_box = GTK_COMBO_BOX (widget);

    obj = gtk_combo_box_get_popup_accessible (combo_box);
    index = gtk_combo_box_get_active (combo_box);

    return atk_object_ref_accessible_child (obj, index);
}
Exemple #9
0
static VALUE
rg_popup_accessible(VALUE self)
{
    return GOBJ2RVAL(gtk_combo_box_get_popup_accessible(_SELF(self)));
}