Ejemplo n.º 1
0
static void
gtk_cell_accessible_object_finalize (GObject *obj)
{
  AtkRelationSet *relation_set;
  AtkRelation *relation;
  GPtrArray *target;
  gpointer target_object;
  gint i;

  relation_set = atk_object_ref_relation_set (ATK_OBJECT (obj));
  if (ATK_IS_RELATION_SET (relation_set))
    {
      relation = atk_relation_set_get_relation_by_type (relation_set,
                                                        ATK_RELATION_NODE_CHILD_OF);
      if (relation)
        {
          target = atk_relation_get_target (relation);
          for (i = 0; i < target->len; i++)
            {
              target_object = g_ptr_array_index (target, i);
              if (GTK_IS_CELL_ACCESSIBLE (target_object))
                g_object_unref (target_object);
            }
        }
      g_object_unref (relation_set);
    }
  G_OBJECT_CLASS (_gtk_cell_accessible_parent_class)->finalize (obj);
}
Ejemplo n.º 2
0
/*
 * CORBA Accessibility::Accessible::getRelationSet method implementation
 */
static Accessibility_RelationSet *
impl_accessibility_accessible_get_relation_set (PortableServer_Servant servant,
						CORBA_Environment     *ev)
{
  Accessibility_RelationSet *retval;
  gint n_relations = 0;
  gint i;
  AtkRelationSet *relation_set;
  AtkObject      *object = get_atkobject_from_servant (servant);

  bonobo_return_val_if_fail (object != NULL, NULL, ev);

  relation_set = atk_object_ref_relation_set (object);

  if (relation_set)
    n_relations = atk_relation_set_get_n_relations (relation_set);

  retval = CORBA_sequence_Accessibility_Relation__alloc ();
  retval->_length = retval->_maximum = n_relations;
  retval->_buffer = CORBA_sequence_Accessibility_Relation_allocbuf (n_relations);
  CORBA_sequence_set_release (retval, CORBA_TRUE);
	  
  for (i = 0; i < n_relations; ++i)
    {
      retval->_buffer[i] =
        CORBA_Object_duplicate (
          BONOBO_OBJREF (
            spi_relation_new (atk_relation_set_get_relation (relation_set, i))),
	  NULL);
    }
  
  return retval;
}
Ejemplo n.º 3
0
/**
 * panel_a11y_set_atk_relation
 * @widget : The Gtk widget which is labelled by @label
 * @label : The label for the @widget.
 *
 * Description : This function establishes atk relation
 * between a gtk widget and a label.
 */
void
panel_a11y_set_atk_relation (GtkWidget *widget,
			     GtkLabel  *label)
{
	AtkObject      *aobject;
	AtkRelationSet *relation_set;
	AtkRelation    *relation; 
	AtkObject      *targets [1];

	g_return_if_fail (GTK_IS_WIDGET(widget));
	g_return_if_fail (GTK_IS_LABEL(label));

	if (!panel_a11y_get_is_a11y_enabled (widget))
		return;

	aobject = gtk_widget_get_accessible (widget);

	gtk_label_set_mnemonic_widget (label, widget);

	targets [0] = gtk_widget_get_accessible (GTK_WIDGET (label));

	relation_set = atk_object_ref_relation_set (aobject);

	relation = atk_relation_new (targets, 1, ATK_RELATION_LABELLED_BY);
	atk_relation_set_add (relation_set, relation);
	g_object_unref (relation);
}
Ejemplo n.º 4
0
JNIEXPORT jint JNICALL ATK_NATIVE(_1atk_1object_1ref_1relation_1set)
	(JNIEnv *env, jclass that, jint arg0)
{
	jint rc = 0;
	ATK_NATIVE_ENTER(env, that, _1atk_1object_1ref_1relation_1set_FUNC);
	rc = (jint)atk_object_ref_relation_set((AtkObject *)arg0);
	ATK_NATIVE_EXIT(env, that, _1atk_1object_1ref_1relation_1set_FUNC);
	return rc;
}
Ejemplo n.º 5
0
static void
add_atk_relation (GtkWidget *w0, GtkWidget *w1, AtkRelationType type)
{
	AtkObject *atk0 = gtk_widget_get_accessible(w0);
	AtkObject *atk1 = gtk_widget_get_accessible(w1);
	AtkRelationSet *relation_set = atk_object_ref_relation_set (atk0);
	AtkRelation *relation = atk_relation_new (&atk1, 1, type);
	atk_relation_set_add (relation_set, relation);
	g_object_unref (relation_set);
	g_object_unref (relation);
}
Ejemplo n.º 6
0
static G_CONST_RETURN gchar*
gail_combo_box_get_keybinding (AtkAction *action,
		                    gint      i)
{
  GailComboBox *combo_box;
  gchar *return_value = NULL;
  switch (i)
  {
     case 0:
      {
	  GtkWidget *widget;
	  GtkWidget *label;
	  AtkRelationSet *set;
	  AtkRelation *relation;
	  GPtrArray *target;
	  gpointer target_object;
	  guint key_val;

	  combo_box = GAIL_COMBO_BOX (action);
	  widget = GTK_ACCESSIBLE (combo_box)->widget;
	  if (widget == NULL)
             return NULL;
	  set = atk_object_ref_relation_set (ATK_OBJECT (action));
	  if (!set)
             return NULL;
	  label = NULL;
	  relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
	  if (relation)
	  {
	     target = atk_relation_get_target (relation);
	     target_object = g_ptr_array_index (target, 0);
	     if (GTK_IS_ACCESSIBLE (target_object))
	     {
	        label = GTK_ACCESSIBLE (target_object)->widget;
	     }
	  }
	  g_object_unref (set);
	  if (GTK_IS_LABEL (label))
	  {
             key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
	     if (key_val != GDK_VoidSymbol)
             return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
	  }
	   g_free (combo_box->press_keybinding);
	   combo_box->press_keybinding = return_value;
	   break;
       }
    default:
	   break;
  }
  return return_value;
}
Ejemplo n.º 7
0
static const gchar *
gtk_combo_box_accessible_get_keybinding (AtkAction *action,
        gint       i)
{
    GtkComboBoxAccessible *combo_box;
    GtkWidget *widget;
    GtkWidget *label;
    AtkRelationSet *set;
    AtkRelation *relation;
    GPtrArray *target;
    gpointer target_object;
    guint key_val;
    gchar *return_value = NULL;

    if (i != 0)
        return NULL;

    combo_box = GTK_COMBO_BOX_ACCESSIBLE (action);
    widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (combo_box));
    if (widget == NULL)
        return NULL;

    set = atk_object_ref_relation_set (ATK_OBJECT (action));
    if (set == NULL)
        return NULL;

    label = NULL;
    relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
    if (relation)
    {
        target = atk_relation_get_target (relation);
        target_object = g_ptr_array_index (target, 0);
        label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
    }
    g_object_unref (set);
    if (GTK_IS_LABEL (label))
    {
        key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
        if (key_val != GDK_KEY_VoidSymbol)
            return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
    }

    return return_value;
}
Ejemplo n.º 8
0
/* sets up ATK Relation between the widgets */
static void add_atk_relation(GtkWidget* widget1, GtkWidget* widget2, AtkRelationType type)
{
	AtkObject* atk_obj1;
	AtkObject* atk_obj2;
	AtkRelationSet* relation_set;
	AtkRelation* relation;

	atk_obj1 = gtk_widget_get_accessible(widget1);

	if (!GTK_IS_ACCESSIBLE(atk_obj1))
	{
		return;
	}

	atk_obj2 = gtk_widget_get_accessible(widget2);

	relation_set = atk_object_ref_relation_set(atk_obj1);
	relation = atk_relation_new(&atk_obj2, 1, type);
	atk_relation_set_add(relation_set, relation);
	g_object_unref(G_OBJECT(relation));
}
AccessibilityUIElement AccessibilityUIElement::titleUIElement()
{
    if (!m_element)
        return 0;

    AtkRelationSet* set = atk_object_ref_relation_set(ATK_OBJECT(m_element));
    if (!set)
        return 0;

    AtkObject* target = 0;
    int count = atk_relation_set_get_n_relations(set);
    for (int i = 0; i < count; i++) {
        AtkRelation* relation = atk_relation_set_get_relation(set, i);
        if (atk_relation_get_relation_type(relation) == ATK_RELATION_LABELLED_BY) {
            GPtrArray* targetList = atk_relation_get_target(relation);
            if (targetList->len)
                target = static_cast<AtkObject*>(g_ptr_array_index(targetList, 0));
        }
    }

    g_object_unref(set);
    return target ? AccessibilityUIElement(target) : 0;
}
Ejemplo n.º 10
0
/**
 * gedit_set_atk_relation:
 * @obj1: specified widget.
 * @obj2: specified widget.
 * @rel_type: the type of relation to set up.
 *
 * This function establishes atk relation
 * between 2 specified widgets.
 */
void
gedit_utils_set_atk_relation (GtkWidget       *obj1,
			      GtkWidget       *obj2,
			      AtkRelationType  rel_type)
{
	AtkObject *atk_obj1, *atk_obj2;
	AtkRelationSet *relation_set;
	AtkObject *targets[1];
	AtkRelation *relation;

	atk_obj1 = gtk_widget_get_accessible (obj1);
	atk_obj2 = gtk_widget_get_accessible (obj2);

	if (!(GTK_IS_ACCESSIBLE (atk_obj1)) || !(GTK_IS_ACCESSIBLE (atk_obj2)))
		return;

	relation_set = atk_object_ref_relation_set (atk_obj1);
	targets[0] = atk_obj2;

	relation = atk_relation_new (targets, 1, rel_type);
	atk_relation_set_add (relation_set, relation);

	g_object_unref (G_OBJECT (relation));
}
Ejemplo n.º 11
0
static DBusMessage *
impl_GetRelationSet (DBusConnection * bus,
                     DBusMessage * message, void *user_data)
{
  AtkObject *object = (AtkObject *) user_data;
  DBusMessage *reply;
  AtkRelationSet *set;
  DBusMessageIter iter, iter_array, iter_struct, iter_targets;
  gint count;
  gint i, j;

  g_return_val_if_fail (ATK_IS_OBJECT (user_data),
                        droute_not_yet_handled_error (message));
  reply = dbus_message_new_method_return (message);
  if (!reply)
    return NULL;
  set = atk_object_ref_relation_set (object);
  dbus_message_iter_init_append (reply, &iter);
  if (!dbus_message_iter_open_container
      (&iter, DBUS_TYPE_ARRAY, "(ua(so))", &iter_array))
    {
      goto oom;
    }
  count = 0;
  if (set)
    count = atk_relation_set_get_n_relations (set);
  for (i = 0; i < count; i++)
    {
      AtkRelation *r = atk_relation_set_get_relation (set, i);
      AtkRelationType rt;
      GPtrArray *target;
      dbus_uint32_t type;
      if (!r)
        continue;
      rt = atk_relation_get_relation_type (r);
      type = spi_relation_type_from_atk_relation_type (rt);
      target = atk_relation_get_target (r);
      if (!dbus_message_iter_open_container
          (&iter_array, DBUS_TYPE_STRUCT, NULL, &iter_struct))
        {
          goto oom;
        }
      dbus_message_iter_append_basic (&iter_struct, DBUS_TYPE_UINT32, &type);
      if (!dbus_message_iter_open_container
          (&iter_struct, DBUS_TYPE_ARRAY, "(so)", &iter_targets))
        {
          goto oom;
        }
      for (j = 0; j < target->len; j++)
        {
          AtkObject *obj = target->pdata[j];
          if (!obj)
            continue;
          spi_object_append_reference (&iter_targets, obj);
        }
      dbus_message_iter_close_container (&iter_struct, &iter_targets);
      dbus_message_iter_close_container (&iter_array, &iter_struct);
    }
  dbus_message_iter_close_container (&iter, &iter_array);
oom:
  if (set)
    g_object_unref (set);
  // TODO: handle out of memory */
  return reply;
}
G_MODULE_EXPORT void
test_init (gchar *path)
{
  AtkObject *r1, *r2, *r3;
  AtkObject *m1, *m2, *m3;
  AtkRelationSet *rset;
  AtkRelation *rel;
  AtkObject *rls[3];

  root_accessible  = g_object_new(MY_TYPE_ATK_OBJECT, NULL);
  
  r1 = ATK_OBJECT(g_object_new(MY_TYPE_ATK_OBJECT,
				  "accessible-name", "r1",
				  "accessible-description", "",
				  "accessible-role", ATK_ROLE_INVALID,
				  NULL));
  my_atk_object_add_child(MY_ATK_OBJECT(root_accessible), MY_ATK_OBJECT(r1));

  r2 = ATK_OBJECT(g_object_new(MY_TYPE_ATK_OBJECT,
				  "accessible-name", "r2",
				  "accessible-description", "",
				  "accessible-role", ATK_ROLE_INVALID,
				  NULL));
  my_atk_object_add_child(MY_ATK_OBJECT(root_accessible), MY_ATK_OBJECT(r2));

  r3 = ATK_OBJECT(g_object_new(MY_TYPE_ATK_OBJECT,
				  "accessible-name", "r3",
				  "accessible-description", "",
				  "accessible-role", ATK_ROLE_INVALID,
				  NULL));
  my_atk_object_add_child(MY_ATK_OBJECT(root_accessible), MY_ATK_OBJECT(r3));

  m1 = ATK_OBJECT(g_object_new(MY_TYPE_ATK_OBJECT,
				  "accessible-name", "m1",
				  "accessible-description", "",
				  "accessible-role", ATK_ROLE_INVALID,
				  NULL));
  my_atk_object_add_child(MY_ATK_OBJECT(root_accessible), MY_ATK_OBJECT(m1));

  m2 = ATK_OBJECT(g_object_new(MY_TYPE_ATK_OBJECT,
				  "accessible-name", "m2",
				  "accessible-description", "",
				  "accessible-role", ATK_ROLE_INVALID,
				  NULL));
  my_atk_object_add_child(MY_ATK_OBJECT(root_accessible), MY_ATK_OBJECT(m2));

  m3 = ATK_OBJECT(g_object_new(MY_TYPE_ATK_OBJECT,
				  "accessible-name", "m3",
				  "accessible-description", "",
				  "accessible-role", ATK_ROLE_INVALID,
				  NULL));
  my_atk_object_add_child(MY_ATK_OBJECT(root_accessible), MY_ATK_OBJECT(m3));

  atk_object_add_relationship(root_accessible, ATK_RELATION_EMBEDS, r1);
  atk_object_add_relationship(root_accessible, ATK_RELATION_PARENT_WINDOW_OF, r2);
  atk_object_add_relationship(root_accessible, ATK_RELATION_DESCRIBED_BY, r3);

  rls[0] = m1;
  rls[1] = m2;
  rls[2] = m3;

  rset = atk_object_ref_relation_set(root_accessible);
  rel = atk_relation_new(rls, 3, ATK_RELATION_POPUP_FOR);
  atk_relation_set_add(rset, rel);
  g_object_unref(G_OBJECT(rset));
}
static void
thunar_sbr_replace_renamer_init (ThunarSbrReplaceRenamer *replace_renamer)
{
  AtkRelationSet *relations;
  AtkRelation    *relation;
  AtkObject      *object;
  GtkWidget      *table;
  GtkWidget      *label;
  GtkWidget      *entry;
  GtkWidget      *button;

#ifdef HAVE_PCRE
  /* check if PCRE supports UTF-8 */
  if (pcre_config (PCRE_CONFIG_UTF8, &replace_renamer->regexp_supported) != 0)
    replace_renamer->regexp_supported = FALSE;
#endif

  /* allocate the shared tooltips */
  replace_renamer->tooltips = gtk_tooltips_new ();
  exo_gtk_object_ref_sink (GTK_OBJECT (replace_renamer->tooltips));

  table = gtk_table_new (2, 3, FALSE);
  gtk_table_set_row_spacings (GTK_TABLE (table), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
  gtk_box_pack_start (GTK_BOX (replace_renamer), table, FALSE, FALSE, 0);
  gtk_widget_show (table);

  label = gtk_label_new_with_mnemonic (_("_Search For:"));
  gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
  gtk_widget_show (label);

  replace_renamer->pattern_entry = gtk_entry_new ();
  gtk_entry_set_activates_default (GTK_ENTRY (replace_renamer->pattern_entry), TRUE);
  exo_mutual_binding_new (G_OBJECT (replace_renamer->pattern_entry), "text", G_OBJECT (replace_renamer), "pattern");
  gtk_tooltips_set_tip (replace_renamer->tooltips, replace_renamer->pattern_entry, _("Enter the text to search for in the file names."), NULL);
  gtk_table_attach (GTK_TABLE (table), replace_renamer->pattern_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), replace_renamer->pattern_entry);
  gtk_widget_show (replace_renamer->pattern_entry);

  /* set Atk label relation for the entry */
  object = gtk_widget_get_accessible (replace_renamer->pattern_entry);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  button = gtk_check_button_new_with_mnemonic (_("Regular _Expression"));
  exo_mutual_binding_new (G_OBJECT (button), "active", G_OBJECT (replace_renamer), "regexp");
  gtk_tooltips_set_tip (replace_renamer->tooltips, button, _("If you enable this option, the pattern will be treated as a regular expression and "
                                                             "matched using the Perl-compatible regular expressions (PCRE). Check the documentation "
                                                             "for details about the regular expression syntax."), NULL);
  gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 1, GTK_FILL, 0, 0, 0);
  gtk_widget_set_sensitive (button, replace_renamer->regexp_supported);
  gtk_widget_show (button);

  label = gtk_label_new_with_mnemonic (_("Replace _With:"));
  gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f);
  gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
  gtk_widget_show (label);

  entry = gtk_entry_new ();
  gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
  exo_mutual_binding_new (G_OBJECT (entry), "text", G_OBJECT (replace_renamer), "replacement");
  gtk_tooltips_set_tip (replace_renamer->tooltips, entry, _("Enter the text that should be used as replacement for the pattern above."), NULL);
  gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
  gtk_widget_show (entry);

  /* set Atk label relation for the entry */
  object = gtk_widget_get_accessible (entry);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  button = gtk_check_button_new_with_mnemonic (_("C_ase Sensitive Search"));
  exo_mutual_binding_new (G_OBJECT (button), "active", G_OBJECT (replace_renamer), "case-sensitive");
  gtk_tooltips_set_tip (replace_renamer->tooltips, button, _("If you enable this option, the pattern will be searched in a case-sensitive manner. "
                                                             "The default is to use a case-insensitive search."), NULL);
  gtk_table_attach (GTK_TABLE (table), button, 2, 3, 1, 2, GTK_FILL, 0, 0, 0);
  gtk_widget_show (button);
}
Ejemplo n.º 14
0
static void
thunar_apr_desktop_page_init (ThunarAprDesktopPage *desktop_page)
{
    AtkRelationSet *relations;
    PangoAttribute *attribute;
    PangoAttrList  *attr_list;
    AtkRelation    *relation;
    AtkObject      *object;
    GtkWidget      *table;
    GtkWidget      *label;

    gtk_container_set_border_width (GTK_CONTAINER (desktop_page), 12);

    /* allocate shared bold Pango attributes */
    attr_list = pango_attr_list_new ();
    attribute = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
    attribute->start_index = 0;
    attribute->end_index = -1;
    pango_attr_list_insert (attr_list, attribute);

    table = gtk_table_new (8, 2, FALSE);
    gtk_table_set_col_spacings (GTK_TABLE (table), 12);
    gtk_table_set_row_spacings (GTK_TABLE (table), 0);
    gtk_container_add (GTK_CONTAINER (desktop_page), table);
    gtk_widget_show (table);

    label = gtk_label_new (_("Description:"));
    gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
    gtk_label_set_attributes (GTK_LABEL (label), attr_list);
    gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (label);

    desktop_page->description_entry = gtk_entry_new ();
    gtk_widget_set_tooltip_text (desktop_page->description_entry, _("The generic name of the entry, for example \"Web Browser\" "
                                 "in case of Firefox."));
    g_signal_connect (G_OBJECT (desktop_page->description_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
    g_signal_connect (G_OBJECT (desktop_page->description_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->description_entry, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->description_entry);

    exo_binding_new (G_OBJECT (desktop_page->description_entry), "visible", G_OBJECT (label), "visible");

    /* set Atk label relation for the entry */
    object = gtk_widget_get_accessible (desktop_page->description_entry);
    relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));

    label = gtk_label_new (_("Command:"));
    gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
    gtk_label_set_attributes (GTK_LABEL (label), attr_list);
    gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (label);

    desktop_page->command_entry = gtk_entry_new ();
    gtk_widget_set_tooltip_text (desktop_page->command_entry, _("The program to execute, possibly with arguments."));
    g_signal_connect (G_OBJECT (desktop_page->command_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
    g_signal_connect (G_OBJECT (desktop_page->command_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->command_entry, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->command_entry);

    exo_binding_new (G_OBJECT (desktop_page->command_entry), "visible", G_OBJECT (label), "visible");

    /* set Atk label relation for the entry */
    object = gtk_widget_get_accessible (desktop_page->command_entry);
    relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));

    label = gtk_label_new (_("Working Directory:"));
    gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
    gtk_label_set_attributes (GTK_LABEL (label), attr_list);
    gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (label);

    desktop_page->path_entry = gtk_entry_new ();
    gtk_widget_set_tooltip_text (desktop_page->path_entry, _("The working directory for the program."));
    g_signal_connect (G_OBJECT (desktop_page->path_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
    g_signal_connect (G_OBJECT (desktop_page->path_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->path_entry, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->path_entry);

    exo_binding_new (G_OBJECT (desktop_page->path_entry), "visible", G_OBJECT (label), "visible");

    /* set Atk label relation for the entry */
    object = gtk_widget_get_accessible (desktop_page->path_entry);
    relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));

    label = gtk_label_new (_("URL:"));
    gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
    gtk_label_set_attributes (GTK_LABEL (label), attr_list);
    gtk_table_attach (GTK_TABLE (table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (label);

    desktop_page->url_entry = gtk_entry_new ();
    gtk_widget_set_tooltip_text (desktop_page->url_entry, _("The URL to access."));
    g_signal_connect (G_OBJECT (desktop_page->url_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
    g_signal_connect (G_OBJECT (desktop_page->url_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->url_entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->url_entry);

    exo_binding_new (G_OBJECT (desktop_page->url_entry), "visible", G_OBJECT (label), "visible");

    /* set Atk label relation for the entry */
    object = gtk_widget_get_accessible (desktop_page->url_entry);
    relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));

    label = gtk_label_new (_("Comment:"));
    gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
    gtk_label_set_attributes (GTK_LABEL (label), attr_list);
    gtk_table_attach (GTK_TABLE (table), label, 0, 1, 4, 5, GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (label);

    desktop_page->comment_entry = gtk_entry_new ();
    gtk_widget_set_tooltip_text (desktop_page->comment_entry, _("Tooltip for the entry, for example \"View sites on the Internet\" "
                                 "in case of Firefox. Should not be redundant with the name or the "
                                 "description."));
    g_signal_connect (G_OBJECT (desktop_page->comment_entry), "activate", G_CALLBACK (thunar_apr_desktop_page_activated), desktop_page);
    g_signal_connect (G_OBJECT (desktop_page->comment_entry), "focus-out-event", G_CALLBACK (thunar_apr_desktop_page_focus_out_event), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->comment_entry, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->comment_entry);

    exo_binding_new (G_OBJECT (desktop_page->comment_entry), "visible", G_OBJECT (label), "visible");

    /* set Atk label relation for the entry */
    object = gtk_widget_get_accessible (desktop_page->comment_entry);
    relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));

    /* add spacing between the entries and the options */
    gtk_table_set_row_spacing (GTK_TABLE (table), 4, 24);

    label = gtk_label_new (_("Options:"));
    gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
    gtk_label_set_attributes (GTK_LABEL (label), attr_list);
    gtk_table_attach (GTK_TABLE (table), label, 0, 1, 6, 7, GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (label);

    desktop_page->snotify_button = gtk_check_button_new_with_mnemonic (_("Use _startup notification"));
    gtk_widget_set_tooltip_text (desktop_page->snotify_button, _("Select this option to enable startup notification when the command "
                                 "is run from the file manager or the menu. Not every application supports "
                                 "startup notification."));
    g_signal_connect (G_OBJECT (desktop_page->snotify_button), "toggled", G_CALLBACK (thunar_apr_desktop_page_toggled), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->snotify_button, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->snotify_button);

    desktop_page->terminal_button = gtk_check_button_new_with_mnemonic (_("Run in _terminal"));
    gtk_widget_set_tooltip_text (desktop_page->terminal_button, _("Select this option to run the command in a terminal window."));
    g_signal_connect (G_OBJECT (desktop_page->terminal_button), "toggled", G_CALLBACK (thunar_apr_desktop_page_toggled), desktop_page);
    gtk_table_attach (GTK_TABLE (table), desktop_page->terminal_button, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
    gtk_widget_show (desktop_page->terminal_button);

    /* set Atk label relation for the buttons */
    relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
    object = gtk_widget_get_accessible (desktop_page->snotify_button);
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));
    object = gtk_widget_get_accessible (desktop_page->terminal_button);
    relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
    atk_relation_set_add (relations, relation);
    g_object_unref (G_OBJECT (relation));

    exo_binding_new (G_OBJECT (desktop_page->snotify_button), "visible", G_OBJECT (label), "visible");

    /* release shared bold Pango attributes */
    pango_attr_list_unref (attr_list);
}
Ejemplo n.º 15
0
static void
thunar_sbr_number_renamer_init (ThunarSbrNumberRenamer *number_renamer)
{
  AtkRelationSet *relations;
  AtkRelation    *relation;
  GEnumClass     *klass;
  AtkObject      *object;
  GtkWidget      *combo;
  GtkWidget      *entry;
  GtkWidget      *label;
  GtkWidget      *hbox;
  guint           n;

  hbox = gtk_hbox_new (FALSE, 12);
  gtk_box_pack_start (GTK_BOX (number_renamer), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  label = gtk_label_new_with_mnemonic (_("_Number Format:"));
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_widget_show (label);

  combo = gtk_combo_box_new_text ();
  klass = g_type_class_ref (THUNAR_SBR_TYPE_NUMBER_MODE);
  for (n = 0; n < klass->n_values; ++n)
    gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(klass->values[n].value_nick));
  exo_mutual_binding_new (G_OBJECT (number_renamer), "mode", G_OBJECT (combo), "active");
  gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
  g_type_class_unref (klass);
  gtk_widget_show (combo);

  /* set Atk label relation for the combo */
  object = gtk_widget_get_accessible (combo);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  number_renamer->start_entry = gtk_entry_new ();
  gtk_entry_set_max_length (GTK_ENTRY (number_renamer->start_entry), 4);
  gtk_entry_set_width_chars (GTK_ENTRY (number_renamer->start_entry), 3);
  gtk_entry_set_alignment (GTK_ENTRY (number_renamer->start_entry), 1.0f);
  gtk_entry_set_activates_default (GTK_ENTRY (number_renamer->start_entry), TRUE);
  exo_mutual_binding_new (G_OBJECT (number_renamer->start_entry), "text", G_OBJECT (number_renamer), "start");
  gtk_box_pack_end (GTK_BOX (hbox), number_renamer->start_entry, TRUE, TRUE, 0);
  gtk_widget_show (number_renamer->start_entry);

  label = gtk_label_new_with_mnemonic (_("_Start With:"));
  gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), number_renamer->start_entry);
  gtk_widget_show (label);

  /* set Atk label relation for the entry */
  object = gtk_widget_get_accessible (number_renamer->start_entry);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  hbox = gtk_hbox_new (FALSE, 12);
  gtk_box_pack_end (GTK_BOX (number_renamer), hbox, FALSE, FALSE, 0);
  gtk_widget_show (hbox);

  label = gtk_label_new_with_mnemonic (_("Text _Format:"));
  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_widget_show (label);

  combo = gtk_combo_box_new_text ();
  klass = g_type_class_ref (THUNAR_SBR_TYPE_TEXT_MODE);
  for (n = 0; n < klass->n_values; ++n)
    gtk_combo_box_append_text (GTK_COMBO_BOX (combo), _(klass->values[n].value_nick));
  exo_mutual_binding_new (G_OBJECT (number_renamer), "text-mode", G_OBJECT (combo), "active");
  gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
  g_type_class_unref (klass);
  gtk_widget_show (combo);

  /* set Atk label relation for the combo */
  object = gtk_widget_get_accessible (combo);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  entry = gtk_entry_new ();
  gtk_entry_set_width_chars (GTK_ENTRY (entry), 4);
  gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
  exo_mutual_binding_new (G_OBJECT (entry), "text", G_OBJECT (number_renamer), "text");
  gtk_box_pack_end (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
  gtk_widget_show (entry);

  label = gtk_label_new_with_mnemonic (_("_Text:"));
  gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
  gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
  gtk_widget_show (label);

  /* set Atk label relation for the entry */
  object = gtk_widget_get_accessible (entry);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));
}
Ejemplo n.º 16
0
Archivo: gailbutton.c Proyecto: BYC/gtk
static G_CONST_RETURN gchar*
gail_button_get_keybinding (AtkAction *action,
                            gint      i)
{
  GailButton *button;
  gchar *return_value = NULL;

  button = GAIL_BUTTON (action);
  if (button->default_is_press)
    {
      if (i == 0)
        i = 1;
      else if (i == 1)
        i = 0;
    }
  switch (i)
    {
    case 0:
      {
        /*
         * We look for a mnemonic on the label
         */
        GtkWidget *widget;
        GtkWidget *label;
        guint key_val; 

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

        g_return_val_if_fail (GTK_IS_BUTTON (widget), NULL);

        label = get_label_from_button (widget, 0, FALSE);
        if (GTK_IS_LABEL (label))
          {
            key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); 
            if (key_val != GDK_KEY_VoidSymbol)
              return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
          }
        if (return_value == NULL)
          {
            /* Find labelled-by relation */
            AtkRelationSet *set;
            AtkRelation *relation;
            GPtrArray *target;
            gpointer target_object;

            set = atk_object_ref_relation_set (ATK_OBJECT (action));
            if (set)
              {
                relation = atk_relation_set_get_relation_by_type (set, ATK_RELATION_LABELLED_BY);
                if (relation)
                  {              
                    target = atk_relation_get_target (relation);
            
                    target_object = g_ptr_array_index (target, 0);
                    label = gtk_accessible_get_widget (GTK_ACCESSIBLE (target_object));
                  }
                g_object_unref (set);
              }

            if (GTK_IS_LABEL (label))
              {
                key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); 
                if (key_val != GDK_KEY_VoidSymbol)
                  return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
              }
          }
        g_free (button->click_keybinding);
        button->click_keybinding = return_value;
        break;
      }
    default:
      break;
    }
  return return_value; 
}
Ejemplo n.º 17
0
static VALUE
rbatkobj_ref_releation_set(VALUE self)
{
    return GOBJ2RVAL(atk_object_ref_relation_set(_SELF(self)));
}
Ejemplo n.º 18
0
static gboolean
test_relation (void)
{
    AtkRelationType type1, type2;
    G_CONST_RETURN gchar *name;
    AtkObject *obj;
    gboolean ret_value;
    AtkRelationSet *set;
    AtkRelation *relation;
    gint n_relations;
    GPtrArray *array;

    name = atk_relation_type_get_name (ATK_RELATION_LABEL_FOR);
    g_return_val_if_fail (name, FALSE);
    if (strcmp (name, "label-for") != 0)
    {
        g_print ("Unexpected name for ATK_RELATION_LABEL_FOR %s\n", name);
        return FALSE;
    }

    name = atk_relation_type_get_name (ATK_RELATION_NODE_CHILD_OF);
    g_return_val_if_fail (name, FALSE);
    if (strcmp (name, "node-child-of") != 0)
    {
        g_print ("Unexpected name for ATK_RELATION_NODE_CHILD_OF %s\n", name);
        return FALSE;
    }

    name = atk_relation_type_get_name (ATK_RELATION_EMBEDS);
    g_return_val_if_fail (name, FALSE);
    if (strcmp (name, "embeds") != 0)
    {
        g_print ("Unexpected name for ATK_RELATION_EMBEDS %s\n", name);
        return FALSE;
    }

    type1 = atk_relation_type_for_name ("embedded-by");
    if (type1 != ATK_RELATION_EMBEDDED_BY)
    {
        g_print ("Unexpected role for ATK_RELATION_EMBEDDED_BY\n");
        return FALSE;
    }

    type1 = atk_relation_type_for_name ("controlled-by");
    if (type1 != ATK_RELATION_CONTROLLED_BY)
    {
        g_print ("Unexpected name for ATK_RELATION_CONTROLLED_BY\n");
        return FALSE;
    }

    type1 = atk_relation_type_register ("test-state");
    name = atk_relation_type_get_name (type1);
    g_return_val_if_fail (name, FALSE);
    if (strcmp (name, "test-state") != 0)
    {
        g_print ("Unexpected name for test-state %s\n", name);
        return FALSE;
    }
    type2 = atk_relation_type_for_name ("test-state");
    if (type1 != type2)
    {
        g_print ("Unexpected type for test-state\n");
        return FALSE;
    }
    type2 = atk_relation_type_for_name ("TEST_STATE");
    if (type2 != 0)
    {
        g_print ("Unexpected type for TEST_STATE\n");
        return FALSE;
    }
    /*
     * Check that a non-existent type returns NULL
     */
    name = atk_relation_type_get_name (ATK_RELATION_LAST_DEFINED + 2);
    if (name)
    {
        g_print ("Unexpected name for undefined type %s\n", name);
        return FALSE;
    }

    obj = g_object_new (ATK_TYPE_OBJECT, NULL);
    ret_value = atk_object_add_relationship (obj, ATK_RELATION_LABEL_FOR, obj);
    if (!ret_value)
    {
        g_print ("Unexpected return value for atk_object_add_relationship\n");
        return FALSE;
    }
    set = atk_object_ref_relation_set (obj);
    if (!set)
    {
        g_print ("Unexpected return value for atk_object_ref_relation_set\n");
        return FALSE;
    }
    n_relations = atk_relation_set_get_n_relations (set);
    if (n_relations != 1)
    {
        g_print ("Unexpected return value (%d) for atk_relation_set_get_n_relations expected value: %d\n", n_relations, 1);
        return FALSE;
    }
    relation = atk_relation_set_get_relation (set, 0);
    if (!relation)
    {
        g_print ("Unexpected return value for atk_object_relation_set_get_relation\n");
        return FALSE;
    }
    type1 = atk_relation_get_relation_type (relation);
    if (type1 != ATK_RELATION_LABEL_FOR)
    {
        g_print ("Unexpected return value for atk_relation_get_relation_type\n");
        return FALSE;
    }
    array = atk_relation_get_target (relation);
    if (obj != g_ptr_array_index (array, 0))
    {
        g_print ("Unexpected return value for atk_relation_get_target\n");
        return FALSE;
    }
    g_object_unref (set);
    ret_value = atk_object_remove_relationship (obj, ATK_RELATION_LABEL_FOR, obj);
    if (!ret_value)
    {
        g_print ("Unexpected return value for atk_object_remove_relationship\n");
        return FALSE;
    }
    set = atk_object_ref_relation_set (obj);
    if (!set)
    {
        g_print ("Unexpected return value for atk_object_ref_relation_set\n");
        return FALSE;
    }
    n_relations = atk_relation_set_get_n_relations (set);
    if (n_relations != 0)
    {
        g_print ("Unexpected return value (%d) for atk_relation_set_get_n_relations expected value: %d\n", n_relations, 0);
        return FALSE;
    }
    g_object_unref (set);
    g_object_unref (obj);
    return TRUE;
}
static void
thunar_sbr_insert_renamer_init (ThunarSbrInsertRenamer *insert_renamer)
{
  AtkRelationSet *relations;
  GtkAdjustment  *adjustment;
  AtkRelation    *relation;
  GEnumClass     *klass;
  AtkObject      *object;
  GtkWidget      *spinner;
  GtkWidget      *combo;
  GtkWidget      *entry;
  GtkWidget      *label;
  GtkWidget      *table;
  GtkWidget      *hbox;
  guint           n;

  table = gtk_table_new (2, 3, FALSE);
  gtk_table_set_row_spacings (GTK_TABLE (table), 6);
  gtk_table_set_col_spacings (GTK_TABLE (table), 12);
  gtk_box_pack_start (GTK_BOX (insert_renamer), table, TRUE, TRUE, 0);
  gtk_widget_show (table);

  combo = gtk_combo_box_text_new ();
  klass = g_type_class_ref (THUNAR_SBR_TYPE_INSERT_MODE);
  for (n = 0; n < klass->n_values; ++n)
    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(klass->values[n].value_nick));
  exo_mutual_binding_new (G_OBJECT (insert_renamer), "mode", G_OBJECT (combo), "active");
  gtk_table_attach (GTK_TABLE (table), combo, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
  g_type_class_unref (klass);
  gtk_widget_show (combo);

  label = gtk_label_new_with_mnemonic (_("_Text:"));
  gtk_table_attach (GTK_TABLE (table), label, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
  gtk_widget_show (label);

  entry = gtk_entry_new ();
  gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
  exo_mutual_binding_new (G_OBJECT (entry), "text", G_OBJECT (insert_renamer), "text");
  gtk_table_attach (GTK_TABLE (table), entry, 2, 3, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
  gtk_widget_show (entry);

  /* set Atk label relation for the entry */
  object = gtk_widget_get_accessible (entry);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  label = gtk_label_new_with_mnemonic (_("_At position:"));
  gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
  gtk_table_attach (GTK_TABLE (table), label, 0, 2, 1, 2, GTK_FILL, 0, 0, 0);
  gtk_widget_show (label);

  hbox = gtk_hbox_new (FALSE, 12);
  gtk_table_attach (GTK_TABLE (table), hbox, 2, 3, 1, 2, GTK_FILL, 0, 0, 0);
  gtk_widget_show (hbox);

  spinner = gtk_spin_button_new_with_range (0u, G_MAXUINT, 1u);
  gtk_entry_set_width_chars (GTK_ENTRY (spinner), 4);
  gtk_entry_set_alignment (GTK_ENTRY (spinner), 1.0f);
  gtk_entry_set_activates_default (GTK_ENTRY (spinner), TRUE);
  gtk_spin_button_set_digits (GTK_SPIN_BUTTON (spinner), 0);
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinner), TRUE);
  gtk_spin_button_set_snap_to_ticks (GTK_SPIN_BUTTON (spinner), TRUE);
  gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinner);
  gtk_widget_show (spinner);

  adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (spinner));
  exo_mutual_binding_new (G_OBJECT (insert_renamer), "offset", G_OBJECT (adjustment), "value");

  /* set Atk label relation for the entry */
  object = gtk_widget_get_accessible (spinner);
  relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label));
  relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR);
  atk_relation_set_add (relations, relation);
  g_object_unref (G_OBJECT (relation));

  combo = gtk_combo_box_text_new ();
  klass = g_type_class_ref (THUNAR_SBR_TYPE_OFFSET_MODE);
  for (n = 0; n < klass->n_values; ++n)
    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(klass->values[n].value_nick));
  exo_mutual_binding_new (G_OBJECT (insert_renamer), "offset-mode", G_OBJECT (combo), "active");
  gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
  g_type_class_unref (klass);
  gtk_widget_show (combo);
}