Commit 0b5f7337 authored by daniel_e's avatar daniel_e
Browse files

Add preliminary support for accessibility using ATK. Unfortunately atkmm is

badly broken in a way that prevents it from being used at all.  And due to a
missing reference in Gtk::Widget::get_accessible_vfunc() I can't even resort to
the C interface for custom derived classes.  Thus most of the code is enclosed
in #if 0 / #endif at the moment.
parent 8f306cbd
2002-12-02 Daniel Elstner <daniel.elstner@gmx.net>
* src/controller.cc (create_action_area):
* src/mainwindow.cc (create_left_pane): Add preliminary support
for accessibility using ATK. Unfortunately atkmm is badly broken
in a way that prevents it from being used at all. And due to a
missing reference in Gtk::Widget::get_accessible_vfunc() I can't
even resort to the C interface for custom derived classes. Thus
most of the code is enclosed in #if 0 / #endif at the moment.
2002-11-29 Daniel Elstner <daniel.elstner@gmx.net>
* src/filetree.cc (on_selection_changed): Ooops, forgot to
......
......@@ -76,6 +76,15 @@ void add_widget_button(Regexxer::ControlItem& control, Gtk::Button& button)
control.add_widget(button);
}
#if 0
/* TODO: Fix atkmm instead. And gtkmm. Fuck.
*/
void set_atk_description(Gtk::Widget& widget, const Glib::ustring& description)
{
atk_object_set_description(gtk_widget_get_accessible(widget.gobj()), description.c_str());
}
#endif
} // anonymous namespace
......@@ -325,6 +334,16 @@ Gtk::Widget* Controller::create_action_area()
Button *const button_replace_all = new ImageLabelButton(Stock::CONVERT, "_All files", true);
box_replace->pack_start(*manage(button_replace_all));
#if 0
set_atk_description(*button_prev_file, "Go to the previous matching file");
set_atk_description(*button_prev, "Go to previous match");
set_atk_description(*button_next, "Go to next match");
set_atk_description(*button_next_file, "Go to the next matching file");
set_atk_description(*button_replace, "Replace current match");
set_atk_description(*button_replace_file, "Replace all matches in the current file");
set_atk_description(*button_replace_all, "Replace all matches in all files");
#endif
add_widget_button(next_file, *button_next_file);
add_widget_button(prev_file, *button_prev_file);
add_widget_button(next_match, *button_next);
......
......@@ -28,6 +28,7 @@
#include "stringutils.h"
#include <glib.h>
#include <atk/atk.h> /* TODO: fix atkmm instead */
#include <gtkmm.h>
#include <algorithm>
#include <functional>
......@@ -315,9 +316,11 @@ Gtk::Widget* MainWindow::create_left_pane()
table->attach(*manage(button_folder), 0, 1, 0, 1, FILL, AttachOptions(0));
button_folder->signal_clicked().connect(SigC::slot(*this, &MainWindow::on_select_folder));
table->attach(*manage(new Label("Pattern:", 0.0, 0.5)), 0, 1, 1, 2, FILL, AttachOptions(0));
Label *const label_pattern = new Label("Pattern:", 0.0, 0.5);
table->attach(*manage(label_pattern), 0, 1, 1, 2, FILL, AttachOptions(0));
table->attach(*manage(entry_folder_ = new Entry()), 1, 2, 0, 1, EXPAND|FILL, AttachOptions(0));
table->attach(*manage(entry_pattern_ = new Entry()), 1, 2, 1, 2, EXPAND|FILL, AttachOptions(0));
label_pattern->set_mnemonic_widget(*entry_pattern_);
entry_folder_ ->signal_activate().connect(controller_.find_files.slot());
entry_pattern_->signal_activate().connect(controller_.find_files.slot());
......@@ -371,10 +374,15 @@ Gtk::Widget* MainWindow::create_right_pane()
table->set_border_width(1);
table->set_spacings(2);
table->attach(*manage(new Label("Search:", 0.0, 0.5)), 0, 1, 0, 1, FILL, AttachOptions(0));
table->attach(*manage(new Label("Replace:", 0.0, 0.5)), 0, 1, 1, 2, FILL, AttachOptions(0));
table->attach(*manage(entry_regex_ = new Entry()), 1, 2, 0, 1, EXPAND|FILL, AttachOptions(0));
Label *const label_search = new Label("Search:", 0.0, 0.5);
table->attach(*manage(label_search), 0, 1, 0, 1, FILL, AttachOptions(0));
table->attach(*manage(entry_regex_ = new Entry()), 1, 2, 0, 1, EXPAND|FILL, AttachOptions(0));
label_search->set_mnemonic_widget(*entry_regex_);
Label *const label_replace = new Label("Replace:", 0.0, 0.5);
table->attach(*manage(label_replace), 0, 1, 1, 2, FILL, AttachOptions(0));
table->attach(*manage(entry_substitution_ = new Entry()), 1, 2, 1, 2, EXPAND|FILL, AttachOptions(0));
label_replace->set_mnemonic_widget(*entry_substitution_);
entry_regex_ ->signal_activate().connect(controller_.find_matches.slot());
entry_substitution_->signal_activate().connect(controller_.find_matches.slot());
......@@ -412,6 +420,10 @@ Gtk::Widget* MainWindow::create_right_pane()
entry_preview_->unset_flags(CAN_FOCUS);
entry_preview_->modify_font(fileview_font_);
// TODO: Fix atkmm instead.
atk_object_set_description(gtk_widget_get_accessible(entry_preview_->Widget::gobj()),
"Preview of the substitution in the current line");
tooltips_.set_tip(*entry_regex_, "A regular expression in Perl syntax");
tooltips_.set_tip(*entry_substitution_, "The new string to substitute. As in Perl, you can "
"refer to parts of the match using $1, $2, etc. "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment