diff options
author | Daniel Burrows <dburrows@debian.org> | 2007-11-15 07:16:22 -0800 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2007-11-15 07:16:22 -0800 |
commit | d4e4a5a7894f36dedf6dd2525095d2a4f98825ca (patch) | |
tree | 5bb59adb01c54146755f316318c5d7992937bef2 | |
parent | af0aea1aeb61331ba3f3624dc0806e76db206d45 (diff) | |
download | aptitude-d4e4a5a7894f36dedf6dd2525095d2a4f98825ca.tar.gz |
Pass over the source tree with sed to eliminate a lot of the mindless search-and-replace I was having to do. (namespace aliases and cleanup are still needed)
38 files changed, 326 insertions, 327 deletions
diff --git a/src/apt_config_treeitems.cc b/src/apt_config_treeitems.cc index 1d120983..b451bea7 100644 --- a/src/apt_config_treeitems.cc +++ b/src/apt_config_treeitems.cc @@ -194,7 +194,7 @@ namespace aptitude const std::wstring &_long_description, const std::string &_dflt) : item(_item), - witem(transcode(_item)), + witem(cw::util::transcode(_item)), description(_description), long_description(_long_description), dflt(_dflt) @@ -229,7 +229,7 @@ namespace aptitude int x = 0; const int maxx = win->getmaxx(); - std::wstring value = transcode(aptcfg->Find(item, dflt.c_str())); + std::wstring value = cw::util::transcode(aptcfg->Find(item, dflt.c_str())); std::wstring::const_iterator valueIt = value.begin(); while(x < maxx) { @@ -273,7 +273,7 @@ namespace aptitude void set_text(const std::wstring &text) { - aptcfg->Set(item, transcode(text)); + aptcfg->Set(item, cw::util::transcode(text)); } void edit() @@ -384,11 +384,11 @@ namespace aptitude const std::wstring value_desc = value_found == choices.end() - ? transcode(value) + ? cw::util::transcode(value) : value_found->second.get_description(); const std::wstring dflt_desc = dflt_found == choices.end() - ? transcode(dflt) + ? cw::util::transcode(dflt) : dflt_found->second.get_description(); std::vector<fragment *> fragments; diff --git a/src/cmdline/cmdline_prompt.cc b/src/cmdline/cmdline_prompt.cc index c385a4f8..4c1afbef 100644 --- a/src/cmdline/cmdline_prompt.cc +++ b/src/cmdline/cmdline_prompt.cc @@ -91,7 +91,7 @@ static string reason_string_list(set<reason> &reasons) } string dep_type = const_cast<pkgCache::DepIterator &>(why->dep).DepType(); - s += transcode(transcode(dep_type).substr(0, 1)); + s += cw::util::transcode(cw::util::transcode(dep_type).substr(0, 1)); s+=": "; s+=why->pkg.Name(); } diff --git a/src/cmdline/cmdline_search.cc b/src/cmdline/cmdline_search.cc index 70e8d166..15a936cd 100644 --- a/src/cmdline/cmdline_search.cc +++ b/src/cmdline/cmdline_search.cc @@ -47,7 +47,7 @@ public: wstring get_param(int n) { - return transcode(r->group(n)); + return cw::util::transcode(r->group(n)); } }; @@ -97,7 +97,7 @@ int cmdline_search(int argc, char *argv[], const char *status_fname, wstring wdisplay_format; - if(!transcode(display_format.c_str(), wdisplay_format)) + if(!cw::util::transcode(display_format.c_str(), wdisplay_format)) { _error->DumpErrors(); fprintf(stderr, _("iconv of %s failed.\n"), display_format.c_str()); diff --git a/src/cmdline/cmdline_show.cc b/src/cmdline/cmdline_show.cc index a1238394..5030883e 100644 --- a/src/cmdline/cmdline_show.cc +++ b/src/cmdline/cmdline_show.cc @@ -42,7 +42,7 @@ ostream &operator<<(ostream &out, const cwidget::fragment_contents &contents) for(cwidget::fragment_line::const_iterator j=i->begin(); j!=i->end(); ++j) s.push_back((*j).ch); - out << transcode(s) << endl; + out << cw::util::transcode(s) << endl; } return out; diff --git a/src/cmdline/cmdline_why.cc b/src/cmdline/cmdline_why.cc index f6cbd41e..4cd011fa 100644 --- a/src/cmdline/cmdline_why.cc +++ b/src/cmdline/cmdline_why.cc @@ -147,7 +147,7 @@ namespace fragment *description_column3_fragment() const { - // Q: can I use a std::string and transcode on the way out instead? + // Q: can I use a std::string and cw::util::transcode on the way out instead? if(!dep.end()) { pkgCache::DepIterator start, end; diff --git a/src/download_screen.cc b/src/download_screen.cc index fbcf42dd..1f02ee4c 100644 --- a/src/download_screen.cc +++ b/src/download_screen.cc @@ -58,13 +58,13 @@ bool download_screen::MediaChange(string Media, string Drive) bool rval=true; - popup_widget(widgets::dialog_yesno(transcode(buf), + popup_widget(widgets::dialog_yesno(cw::util::transcode(buf), arg(sigc::bind(sigc::ptr_fun(set_and_exit), rval, true)), - transcode(_("Continue")), + cw::util::transcode(_("Continue")), arg(sigc::bind(sigc::ptr_fun(set_and_exit), rval, false)), - transcode(_("Abort")), + cw::util::transcode(_("Abort")), get_style("MediaChange"))); toplevel::mainloop(); // Eeeeeek! Recursive mainloop! I'm afraid.. @@ -181,7 +181,7 @@ void download_screen::Stop() snprintf(buf, 256, _("Downloaded %sB in %ss (%sB/s)."), SizeToStr(FetchedBytes).c_str(), TimeToStr(ElapsedTime).c_str(), SizeToStr(CurrentCPS).c_str()); - popup_widget(widgets::dialog_ok(transcode(buf), + popup_widget(widgets::dialog_ok(cw::util::transcode(buf), arg(sigc::ptr_fun(toplevel::exitmain)))); toplevel::mainloop(); @@ -230,11 +230,11 @@ void download_screen::paint_status() } #endif -bool download_screen::handle_key(const key &k) +bool download_screen::handle_key(const cwi::key &k) { widgets::widget_ref tmpref(this); - if(global_bindings.key_matches(k, "Quit")) + if(cw::global_bindings.key_matches(k, "Quit")) cancelled=true; else return widgets::tree::handle_key(k); diff --git a/src/download_screen.h b/src/download_screen.h index c33487af..10eb5fe1 100644 --- a/src/download_screen.h +++ b/src/download_screen.h @@ -60,7 +60,7 @@ class download_tree:public cwidget::widgets::subtree_generic public: download_tree():cwidget::widgets::subtree_generic(true) {} - void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const style &style) + void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const cwidget::style &style) {cwidget::widgets::subtree_generic::paint(win, y, hierarchical, L"ERROR: SHOULD NOT APPEAR");} const wchar_t * tag() {return L"download tree";} const wchar_t * label() {return L"download tree";} @@ -95,7 +95,7 @@ class download_screen:public cwidget::widgets::tree, public pkgAcquireStatus } protected: - bool handle_key(const key &k); + bool handle_key(const cwidget::key &k); public: download_screen():prev(NULL),finished(false),cancelled(false) {contents=new download_tree; set_root(contents);} diff --git a/src/edit_pkg_hier.cc b/src/edit_pkg_hier.cc index 0a83f038..f0f13cc8 100644 --- a/src/edit_pkg_hier.cc +++ b/src/edit_pkg_hier.cc @@ -50,15 +50,15 @@ class widgets::hier_editor::widgets::hier_item:public sigc::trackable, public wi wstring group_name; public: widgets::hier_item(pkg_hier::group *_group, pkg_hier::item *_item) - :widgets::treeitem(true), group(_group), group_name(transcode(group->name, "ASCII")) + :widgets::treeitem(true), group(_group), group_name(cw::util::transcode(group->name, "ASCII")) { set_item(_item); } - bool dispatch_key(const key &k, widgets::tree *owner) + bool dispatch_key(const cwi::key &k, widgets::tree *owner) { - if(global_bindings.key_matches(k, "PushButton") || - global_bindings.key_matches(k, "Confirm")) + if(cw::global_bindings.key_matches(k, "PushButton") || + cw::global_bindings.key_matches(k, "Confirm")) { selected=!selected; toplevel::update(); @@ -81,7 +81,7 @@ public: widgets::treeitem::dispatch_mouse(id, x, bstate, owner); } - void paint(widgets::tree *win, int y, bool hierarchical, const style &st) + void paint(widgets::tree *win, int y, bool hierarchical, const cw::style const style &st) { string::size_type width=win->get_width(); string todisp=" "; @@ -99,7 +99,7 @@ public: while(todisp.size()<width) todisp+=" "; - win->mvaddnstr(y, 0, transcode(todisp, "ASCII"), width); + win->mvaddnstr(y, 0, cw::util::transcode(todisp, "ASCII"), width); } const wchar_t *tag() @@ -143,7 +143,7 @@ public: silly_subtree(bool expanded, const wstring &_txt) :widgets::subtree_generic(expanded), txt(_txt) {} - void paint(widgets::tree *win, int y, bool hierarchical, const style &st) + void paint(widgets::tree *win, int y, bool hierarchical, const cw::style const style &st) { widgets::subtree_generic::paint(win, y, hierarchical, txt); } @@ -178,7 +178,7 @@ bool widgets::hier_editor::get_cursorvisible() return true; } -void widgets::hier_editor::paint(const style &st) +void widgets::hier_editor::paint(const cw::style const style &st) { if(!item) mvaddnstr(0, 0, _("No hierarchy information to edit"), get_width()); @@ -319,9 +319,9 @@ void widgets::hier_editor::save_hier(string file) fclose(f); } -bool widgets::hier_editor::handle_key(const key &k) +bool widgets::hier_editor::handle_key(const cwi::key &k) { - if(global_bindings.key_matches(k, "SaveHier")) + if(cw::global_bindings.key_matches(k, "SaveHier")) { string homedir = get_homedir(); string cfgfile; @@ -337,7 +337,7 @@ bool widgets::hier_editor::handle_key(const key &k) cfgfile = homedir + "/.aptitude/function_pkgs"; save_hier(cfgfile); } - else if(global_bindings.key_matches(k, "Quit")) + else if(cw::global_bindings.key_matches(k, "Quit")) { if(item) { @@ -350,7 +350,7 @@ bool widgets::hier_editor::handle_key(const key &k) hide(); } - else if(global_bindings.key_matches(k, "Commit")) + else if(cw::global_bindings.key_matches(k, "Commit")) { if(item) { @@ -363,7 +363,7 @@ bool widgets::hier_editor::handle_key(const key &k) commit_changes(); } - else if(global_bindings.key_matches(k, "Abort")) + else if(cw::global_bindings.key_matches(k, "Abort")) hide(); else return widgets::tree::handle_key(k); diff --git a/src/edit_pkg_hier.h b/src/edit_pkg_hier.h index 27c90987..2a743d00 100644 --- a/src/edit_pkg_hier.h +++ b/src/edit_pkg_hier.h @@ -53,9 +53,9 @@ class hier_editor : public cwidget::widgets::tree void handle_reload(); protected: - virtual bool handle_key(const key &k); + virtual bool handle_key(const cwidget::key &k); - void paint(const style &st); + void paint(const cwidget::style const style &st); hier_editor(); public: diff --git a/src/generic/apt/apt.cc b/src/generic/apt/apt.cc index 842e68c2..a1a9a391 100644 --- a/src/generic/apt/apt.cc +++ b/src/generic/apt/apt.cc @@ -884,7 +884,7 @@ std::wstring get_short_description(const pkgCache::VerIterator &ver, if(vf.end()) return std::wstring(); else - return transcode(records->Lookup(vf).ShortDesc()); + return cw::util::transcode(records->Lookup(vf).ShortDesc()); #else pkgCache::DescIterator d = ver.TranslatedDescription(); @@ -896,7 +896,7 @@ std::wstring get_short_description(const pkgCache::VerIterator &ver, if(df.end()) return std::wstring(); else - // apt "helpfully" transcodes the description for us, instead of + // apt "helpfully" cw::util::transcodes the description for us, instead of // providing direct access to it. So I need to assume that the // description is encoded in the current locale. return cwidget::util::transcode(records->Lookup(df).ShortDesc()); @@ -915,7 +915,7 @@ std::wstring get_long_description(const pkgCache::VerIterator &ver, if(vf.end()) return std::wstring(); else - return transcode(records->Lookup(vf).LongDesc()); + return cw::util::transcode(records->Lookup(vf).LongDesc()); #else pkgCache::DescIterator d = ver.TranslatedDescription(); diff --git a/src/generic/apt/matchers.cc b/src/generic/apt/matchers.cc index d5732801..8027643c 100644 --- a/src/generic/apt/matchers.cc +++ b/src/generic/apt/matchers.cc @@ -371,7 +371,7 @@ public: if(ver.end()) return match_target(false, ""); else - return match_target(true, transcode(get_long_description(ver, &records).c_str())); + return match_target(true, cw::util::transcode(get_long_description(ver, &records).c_str())); } }; diff --git a/src/load_config.cc b/src/load_config.cc index c1dc2d1e..03c1a53f 100644 --- a/src/load_config.cc +++ b/src/load_config.cc @@ -174,7 +174,7 @@ void load_bindings(std::string group, keybindings *toload, bool use_theme) newsplit=i->Value.find(',',split); string currval(i->Value, split, newsplit-split); - key k=parse_key(transcode(currval)); + key k=parse_key(cw::util::transcode(currval)); if(k.ch!=(wint_t) ERR) newbinding.push_back(k); @@ -182,7 +182,7 @@ void load_bindings(std::string group, keybindings *toload, bool use_theme) _error->Error(_("Ignoring invalid keybinding \"%s\" -> \"%s\""), i->Tag.c_str(), currval.c_str()); split=newsplit+1; } while(newsplit!=string::npos); - global_bindings.set(i->Tag, newbinding); + cw::global_bindings.set(i->Tag, newbinding); } } } diff --git a/src/load_grouppolicy.cc b/src/load_grouppolicy.cc index 8b930678..7207d632 100644 --- a/src/load_grouppolicy.cc +++ b/src/load_grouppolicy.cc @@ -652,7 +652,7 @@ class pattern_policy_parser : public group_policy_parser } } - subgroups.push_back(pkg_grouppolicy_matchers_factory::match_pair(matcher.release(), transcode(format), passthrough)); + subgroups.push_back(pkg_grouppolicy_matchers_factory::match_pair(matcher.release(), cw::util::transcode(format), passthrough)); if(begin != end && *begin == ',') ++begin; diff --git a/src/load_pkgview.cc b/src/load_pkgview.cc index 0e440d88..6ad5de41 100644 --- a/src/load_pkgview.cc +++ b/src/load_pkgview.cc @@ -86,7 +86,7 @@ std::list<package_view_item> *load_pkgview(std::string cfggroup) colinf=subtree.Find("Columns"); std::wstring wcolinf; - if(!transcode(colinf.c_str(), wcolinf)) + if(!cw::util::transcode(colinf.c_str(), wcolinf)) { _error->Error(_("Couldn't parse layout: encoding error in column descriptor")); delete rval; diff --git a/src/main.cc b/src/main.cc index 7bcf39c7..3621b183 100644 --- a/src/main.cc +++ b/src/main.cc @@ -74,7 +74,7 @@ namespace toplevel = cwidget::toplevel; #if 0 // These are commented out so as to not punish users unduly for coding -// errors. The transcoder now substitutes conspicuous '?' characters +// errors. The cw::util::transcoder now substitutes conspicuous '?' characters // into its output, which should be enough of a clue. @@ -210,8 +210,8 @@ int main(int argc, char *argv[]) // See earlier note // - //transcode_mbtow_err=handle_mbtow_error; - //transcode_wtomb_err=handle_wtomb_error; + //cw::util::transcode_mbtow_err=handle_mbtow_error; + //cw::util::transcode_wtomb_err=handle_wtomb_error; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); diff --git a/src/menu_text_layout.cc b/src/menu_text_layout.cc index 25e8cd28..8c31313f 100644 --- a/src/menu_text_layout.cc +++ b/src/menu_text_layout.cc @@ -34,7 +34,7 @@ bool menu_text_layout::find_search_enabled() bool menu_text_layout::find_search() { - prompt_string(transcode(_("Search for: ")), + prompt_string(cw::util::transcode(_("Search for: ")), last_search, arg(sigc::mem_fun(this, &menu_text_layout::do_find_search)), NULL, @@ -67,7 +67,7 @@ bool menu_text_layout::find_search_back_enabled() bool menu_text_layout::find_search_back() { prompt_string(_("Search backwards for: "), - transcode(last_search), + cw::util::transcode(last_search), arg(sigc::mem_fun(this, &menu_text_layout::do_find_search_back)), NULL, NULL, @@ -123,15 +123,15 @@ bool menu_text_layout::find_repeat_search_back() } -bool menu_text_layout::handle_key(const key &k) +bool menu_text_layout::handle_key(const cwi::key &k) { - if(global_bindings.key_matches(k, "Search")) + if(cw::global_bindings.key_matches(k, "Search")) find_search(); - else if(global_bindings.key_matches(k, "SearchBack")) + else if(cw::global_bindings.key_matches(k, "SearchBack")) find_search_back(); - else if(global_bindings.key_matches(k, "ReSearch")) + else if(cw::global_bindings.key_matches(k, "ReSearch")) find_research(); - else if(global_bindings.key_matches(k, "RepeatSearchBack")) + else if(cw::global_bindings.key_matches(k, "RepeatSearchBack")) find_repeat_search_back(); else return widgets::text_layout::handle_key(k); diff --git a/src/menu_text_layout.h b/src/menu_text_layout.h index 75f13efa..274d0833 100644 --- a/src/menu_text_layout.h +++ b/src/menu_text_layout.h @@ -69,7 +69,7 @@ public: return rval; } - bool handle_key(const key &k); + bool handle_key(const cwidget::key &k); bool find_search_enabled(); bool find_search(); diff --git a/src/menu_tree.cc b/src/menu_tree.cc index 27a0f960..573325ce 100644 --- a/src/menu_tree.cc +++ b/src/menu_tree.cc @@ -205,7 +205,7 @@ bool menu_tree::find_search_enabled() bool menu_tree::find_search() { - prompt_string(transcode(_("Search for: ")), + prompt_string(cw::util::transcode(_("Search for: ")), last_search_term, arg(sigc::bind(sigc::mem_fun(*this, &menu_tree::do_search), false)), arg(sigc::mem_fun(*this, &menu_tree::do_cancel_incsearch)), @@ -222,7 +222,7 @@ bool menu_tree::find_search_back_enabled() bool menu_tree::find_search_back() { - prompt_string(transcode(_("Search backwards for: ")), + prompt_string(cw::util::transcode(_("Search backwards for: ")), last_search_term, arg(sigc::bind(sigc::mem_fun(*this, &menu_tree::do_search), true)), arg(sigc::mem_fun(*this, &menu_tree::do_cancel_incsearch)), @@ -323,7 +323,7 @@ void menu_tree::do_search(std::wstring s, bool backward) { delete last_search_matcher; last_search_term=s; - last_search_matcher=parse_pattern(transcode(s)); + last_search_matcher=parse_pattern(cw::util::transcode(s)); } if(doing_incsearch) @@ -356,7 +356,7 @@ void menu_tree::do_incsearch(std::wstring s, bool backward) pre_incsearch_selected=get_selection(); } - pkg_matcher *m=parse_pattern(transcode(s), false, false); + pkg_matcher *m=parse_pattern(cw::util::transcode(s), false, false); set_selection(pre_incsearch_selected); @@ -388,7 +388,7 @@ void menu_tree::reset_incsearch() pre_incsearch_selected=get_end(); } -bool menu_tree::handle_key(const key &k) +bool menu_tree::handle_key(const cwi::key &k) { // ick -- but having our own bindings is also ugly. hm. if(pkg_tree::bindings->key_matches(k, "Search")) diff --git a/src/mine/cmine.cc b/src/mine/cmine.cc index 988fc80d..7f02f0f1 100644 --- a/src/mine/cmine.cc +++ b/src/mine/cmine.cc @@ -48,9 +48,8 @@ #define MINE_LRCORNER L'+' #endif -using cwidget::get_style; -using cwidget::util::transcode; using namespace std; +namespace cw = cwidget; namespace dialogs = cwidget::dialogs; namespace toplevel = cwidget::toplevel; namespace widgets = cwidget::widgets; @@ -108,13 +107,13 @@ void cmine::paint_header(const cwidget::style &st) int width,height; getmaxyx(height,width); - wstring header=transcode(_("Minesweeper")); + wstring header=cw::util::transcode(_("Minesweeper")); wchar_t buf[200]; if(board->get_state()==mine_board::playing) swprintf(buf, sizeof(buf), - transcode(_("%i/%i mines %d %s")).c_str(), + cw::util::transcode(_("%i/%i mines %d %s")).c_str(), board->get_nummines()-board->get_numflags(), board->get_nummines(), (int) board->get_duration(), @@ -122,7 +121,7 @@ void cmine::paint_header(const cwidget::style &st) else swprintf(buf, sizeof(buf), - transcode(_(" %s in %d %s")).c_str(), + cw::util::transcode(_(" %s in %d %s")).c_str(), board->get_state()==mine_board::won?_("Won"):_("Lost"), (int) board->get_duration(), board->get_duration()==1?_("second"):_("seconds")); @@ -150,7 +149,7 @@ void cmine::paint_header(const cwidget::style &st) display_header(header, st+get_style("Header")); } else - display_header(transcode(_("Minesweeper")), + display_header(cw::util::transcode(_("Minesweeper")), st+get_style("Header")); } @@ -158,7 +157,7 @@ void cmine::do_load_game(wstring ws) { widgets::widget_ref tmpref(this); - string s=transcode(ws); + string s=cw::util::transcode(ws); if(s!="") { @@ -169,7 +168,7 @@ void cmine::do_load_game(wstring ws) snprintf(buf, 512, _("Could not open file \"%s\""), s.c_str()); - popup_widget(dialogs::ok(transcode(buf), NULL, + popup_widget(dialogs::ok(cw::util::transcode(buf), NULL, get_style("Error"))); } else @@ -185,7 +184,7 @@ void cmine::do_load_game(wstring ws) snprintf(buf, 512, _("Could not load game from %s"), s.c_str()); - popup_widget(dialogs::ok(transcode(buf), NULL, + popup_widget(dialogs::ok(cw::util::transcode(buf), NULL, get_style("Error"))); delete brd; } @@ -202,7 +201,7 @@ void cmine::do_save_game(wstring ws) { widgets::widget_ref tmpref(this); - string s=transcode(ws); + string s=cw::util::transcode(ws); if(s!="") { @@ -213,7 +212,7 @@ void cmine::do_save_game(wstring ws) snprintf(buf, 512, _("Could not open file \"%s\""), s.c_str()); - popup_widget(dialogs::ok(transcode(buf), NULL, + popup_widget(dialogs::ok(cw::util::transcode(buf), NULL, get_style("Error"))); } else @@ -249,7 +248,7 @@ void cmine::do_start_custom_game(widgets::widget &w_bare, // // // That's ok, they'll do that anyway in a couple releases ;-) - popup_widget(dialogs::ok(transcode(_("The board height must be a positive integer")), + popup_widget(dialogs::ok(cw::util::transcode(_("The board height must be a positive integer")), NULL, get_style("Error"))); return; @@ -261,7 +260,7 @@ void cmine::do_start_custom_game(widgets::widget &w_bare, if(s.c_str()[0]=='\0' || *end!='\0' || width<1) { - popup_widget(dialogs::ok(transcode(_("The board width must be a positive integer")), + popup_widget(dialogs::ok(cw::util::transcode(_("The board width must be a positive integer")), NULL, get_style("Error"))); return; @@ -273,7 +272,7 @@ void cmine::do_start_custom_game(widgets::widget &w_bare, if(s.c_str()[0]=='\0' || *end!='\0' || mines<1) { - popup_widget(dialogs::ok(transcode(_("Invalid mine count; please enter a positive integer")), + popup_widget(dialogs::ok(cw::util::transcode(_("Invalid mine count; please enter a positive integer")), NULL, get_style("Error"))); return; @@ -374,12 +373,12 @@ void cmine::do_new_game() using cwidget::config::global_bindings; - table->connect_key_post("Confirm", &global_bindings, okbutton->pressed.make_slot()); + table->connect_key_post("Confirm", &cw::global_bindings, okbutton->pressed.make_slot()); - easybutton->connect_key("Confirm", &global_bindings, okbutton->pressed.make_slot()); - mediumbutton->connect_key("Confirm", &global_bindings, okbutton->pressed.make_slot()); - hardbutton->connect_key("Confirm", &global_bindings, okbutton->pressed.make_slot()); - custombutton->connect_key("Confirm", &global_bindings, okbutton->pressed.make_slot()); + easybutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot()); + mediumbutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot()); + hardbutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot()); + custombutton->connect_key("Confirm", &cw::global_bindings, okbutton->pressed.make_slot()); widgets::radiogroup *grp = new widgets::radiogroup; grp->add_button(easybutton, 0); @@ -437,7 +436,7 @@ void cmine::do_continue_new_game(bool start, do_custom_game(); break; default: - popup_widget(dialogs::ok(transcode("Internal error: execution reached an impossible point"), + popup_widget(dialogs::ok(cw::util::transcode("Internal error: execution reached an impossible point"), NULL, get_style("Error"))); break; @@ -467,10 +466,10 @@ void cmine::checkend() if(board->get_state()==mine_board::won) // "You hold up the Amulet of Yendor. An invisible choir sings..." - popup_widget(dialogs::ok(transcode(_("You have won.")))); + popup_widget(dialogs::ok(cw::util::transcode(_("You have won.")))); else if(board->get_state()==mine_board::lost) { - popup_widget(dialogs::ok(transcode(_("You lose!")))); + popup_widget(dialogs::ok(cw::util::transcode(_("You lose!")))); #if 0 // (messages in reverse order because the minibuf is a stack by default.. // I could use the special feature of sticking them at the end, but I @@ -951,11 +950,11 @@ void cmine::init_bindings() using cwidget::config::key; using cwidget::config::keybindings; - global_bindings.set("MineUncoverSweepSquare", key(KEY_ENTER, true)); - global_bindings.set("MineFlagSquare", key(L'f', false)); - global_bindings.set("MineNewGame", key(L'n', false)); - global_bindings.set("MineSaveGame", key(L'S', false)); - global_bindings.set("MineLoadGame", key(L'L', false)); + cw::global_bindings.set("MineUncoverSweepSquare", key(KEY_ENTER, true)); + cw::global_bindings.set("MineFlagSquare", key(L'f', false)); + cw::global_bindings.set("MineNewGame", key(L'n', false)); + cw::global_bindings.set("MineSaveGame", key(L'S', false)); + cw::global_bindings.set("MineLoadGame", key(L'L', false)); - bindings = new keybindings(&global_bindings); + bindings = new keybindings(&cw::global_bindings); } diff --git a/src/pkg_columnizer.cc b/src/pkg_columnizer.cc index 16c5bbe0..4b68ae0d 100644 --- a/src/pkg_columnizer.cc +++ b/src/pkg_columnizer.cc @@ -665,10 +665,10 @@ void pkg_item::pkg_columnizer::setup_columns(bool force_update) { std::wstring cfg; - if(!transcode(aptcfg->Find(PACKAGE "::UI::Package-Display-Format", + if(!cw::util::transcode(aptcfg->Find(PACKAGE "::UI::Package-Display-Format", default_pkgdisplay).c_str(), cfg)) - _error->Errno("iconv", _("Unable to transcode package display format after \"%ls\""), cfg.c_str()); + _error->Errno("iconv", _("Unable to cw::util::transcode package display format after \"%ls\""), cfg.c_str()); else columns=parse_columns(cfg, pkg_columnizer::parse_column_type, @@ -676,8 +676,8 @@ void pkg_item::pkg_columnizer::setup_columns(bool force_update) if(!columns) { cfg.clear(); - if(!transcode(default_pkgdisplay, cfg)) - _error->Errno("iconv", _("Unable to transcode package display format after \"%ls\""), cfg.c_str()); + if(!cw::util::transcode(default_pkgdisplay, cfg)) + _error->Errno("iconv", _("Unable to cw::util::transcode package display format after \"%ls\""), cfg.c_str()); else columns=parse_columns(cfg, pkg_columnizer::parse_column_type, diff --git a/src/pkg_grouppolicy.cc b/src/pkg_grouppolicy.cc index 94206384..6bdddba1 100644 --- a/src/pkg_grouppolicy.cc +++ b/src/pkg_grouppolicy.cc @@ -158,52 +158,52 @@ void pkg_grouppolicy_section::init_section_descriptions() if(already_done) return; - section_descriptions["Tasks"]=transcode(_("Packages which set up your computer to perform a particular task\n Packages in the 'Tasks' section contain no files; they merely depend upon other packages. These packages provide an easy way to select a predefined set of packages for a specialized task.")); - - section_descriptions["Unknown"]=transcode(_("Packages with no declared section\n No section is given for these packages. Perhaps there is an error in the Packages file?")); - - section_descriptions["admin"]=transcode(_("Administrative utilities (install software, manage users, etc)\n Packages in the 'admin' section allow you to perform administrative tasks such as installing software, managing users, configuring and monitoring your system, examining network traffic, and so on.")); - - section_descriptions["alien"]=transcode(_("Packages converted from foreign formats (rpm, tgz, etc)\n Packages in the 'alien' section were created by the 'alien' program from a non-Debian package format such as RPM")); - section_descriptions["base"]=transcode(_("The Debian base system\n Packages in the 'base' section are part of the initial system installation.")); - section_descriptions["comm"]=transcode(_("Programs for faxmodems and other communication devices\n Packages in the 'comm' section are used to control modems and other hardware communications devices. This includes software to control faxmodems (for instance, PPP for dial-up internet connections and programs originally written for that purpose, such as zmodem/kermit), as well as software to control cellular phones, interface with FidoNet, and run a BBS.")); - section_descriptions["devel"]=transcode(_("Utilities and programs for software development\n Packages in the 'devel' section are used to write new software and work on existing software. Non-programmers who do not compile their own software probably do not need much software from this section.\n .\n It includes compilers, debugging tools, programmer's editors, source processing tools, and other things related to software development.")); - section_descriptions["doc"]=transcode(_("Documentation and specialized programs for viewing documentation\n Packages in the 'doc' section document parts of the Debian system, or are viewers for documentation formats.")); - section_descriptions["editors"]=transcode(_("Text editors and word processors\n Packages in the 'editors' section allow you to edit plain ASCII text. These are not necessarily word processors, although some word processors may be found in this section.")); - section_descriptions["electronics"]=transcode(_("Programs for working with circuits and electronics\n Packages in the 'electronics' section include circuit design tools, simulators and assemblers for microcontrollers, and other related software.")); - section_descriptions["embedded"]=transcode(_("Programs for embedded systems\n Packages in the 'embedded' section are meant to run on embedded devices. Embedded devices are specialized hardware devices with much less power than a typical desktop system: for instance, a PDA, a cell phone, or a Tivo.")); - section_descriptions["gnome"]=transcode(_("The GNOME Desktop System\n GNOME is a collection of software which provides an easy-to-use desktop environment for Linux. Packages in the 'gnome' section are part of the GNOME environment or closely integrated into it.")); - section_descriptions["games"]=transcode(_("Games, toys, and fun programs\n Packages in the 'games' section are meant primarily for entertainment.")); - section_descriptions["graphics"]=transcode(_("Utilities to create, view, and edit graphics files\n Packages in the 'graphics' section include viewers for image files, image processing and manipulation software, software to interact with graphics hardware (such as video cards, scanners, and digital cameras), and programming tools for handling graphics.")); - section_descriptions["hamradio"]=transcode(_("Software for ham radio operators\n Packages in the 'hamradio' section are meant primarily for ham radio operators.")); - section_descriptions["interpreters"]=transcode(_("Interpreters for interpreted languages\n Packages in the 'interpreters' section include interpreters for languages like Python, Perl, and Ruby, and libraries for these same languages.")); - section_descriptions["kde"]=transcode(_("The KDE Desktop System\n KDE is a collection of software which provides an easy-to-use desktop environment for Linux. Packages in the 'kde' section are part of the KDE environment or closely integrated into it.")); - section_descriptions["libdevel"]=transcode(_("Development files for libraries\n Packages in the 'libdevel' section contain files required for building programs that use libraries in the 'libs' section. You don't need packages from this section unless you want to compile software yourself.")); - section_descriptions["libs"]=transcode(_("Collections of software routines\n Packages in the 'libs' section provide necessary functionality for other software on the computer. With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies.")); - section_descriptions["perl"]=transcode(_("Perl interpreter and libraries\n Packages in the 'perl' section provide the Perl programming language and many third-party libraries for it. Unless you are a Perl programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required.")); - section_descriptions["python"]=transcode(_("Python interpreter and libraries\n Packages in the 'python' section provide the Python programming language and many third-party libraries for it. Unless you are a Python programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required.")); - section_descriptions["mail"]=transcode(_("Programs to write, send, and route email messages\n Packages in the 'mail' section include mail readers, mail transport daemons, mailing list software, and spam filters, as well as various other software related to electronic mail.")); - section_descriptions["math"]=transcode(_("Numeric analysis and other mathematics-related software\n Packages in the 'math' section include calculators, languages for mathematical computation (similar to Mathematica), symbolic algebra packages, and programs to visualize mathematical objects.")); - section_descriptions["misc"]=transcode(_("Miscellaneous software\n Packages in the 'misc' section have too unusual a function to be classified.")); - section_descriptions["net"]=transcode(_("Programs to connect to and provide various services\n Packages in the 'net' section include clients and servers for many protocols, tools to manipulate and debug low-level network protocols, IM systems, and other network-related software.")); - section_descriptions["news"]=transcode(_("Usenet clients and servers\n Packages in the 'news' section are related to the Usenet distributed news system. They include news readers and news servers.")); - section_descriptions["oldlibs"]=transcode(_("Obsolete libraries\n Packages in the 'oldlibs' section are obsolete and should not be used by new software. They are provided for compatibility reasons, or because software distributed by Debian still requires them.\n .\n With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies.")); - section_descriptions["otherosfs"]=transcode(_("Emulators and software to read foreign filesystems\n Packages in the 'otherosfs' section emulate hardware and operating systems and provide tools for transferring data between different operating systems and hardware platforms. (for instance, utilities to read DOS floppies, and utilities to communicate with Palm Pilots)\n .\n It is worth noting that CD burning software is included in THIS section.")); - section_descriptions["science"]=transcode(_("Software for scientific work\n Packages in the 'science' section include tools for astronomy, biology, and chemistry, as well as other science-related software.")); - section_descriptions["shells"]=transcode(_("Command shells and alternative console environments\n Packages in the 'shells' section include programs providing a command-line interface.")); - section_descriptions["sound"]=transcode(_("Utilities to play and record sound\n Packages in the 'sound' section include sound players, recorders, and encoders for many formats, mixers and volume controls, MIDI sequencers and programs to generate musical notation, drivers for sound hardware, and sound processing software.")); - section_descriptions["tex"]=transcode(_("The TeX typesetting system\n Packages in the 'tex' section are related to TeX, a system for producing high-quality typeset output. They include TeX itself, TeX packages, editors designed for TeX, utilities to convert TeX and TeX output files to various formats, TeX fonts, and other software related to TeX.")); - section_descriptions["text"]=transcode(_("Text processing utilities\n Packages in the 'text' section include text filters and processors, spelling checkers, dictionary programs, utilities to convert between character encodings and text file formats (eg, Unix and DOS), text formatters and pretty-printers, and other software which operates on plain text.")); - section_descriptions["utils"]=transcode(_("Various system utilities\n Packages in the 'utils' section are utilities whose purpose is too unique to be classified.")); - section_descriptions["web"]=transcode(_("Web browsers, servers, proxies, and other tools\n Packages in the 'web' section include Web browsers, Web servers and proxies, software to write CGI scripts or Web-based programs, pre-written Web-based programs, and other software related to the World Wide Web.")); - section_descriptions["x11"]=transcode(_("The X window system and related software\n Packages in the 'x11' section include the core packages for the X window system, window managers, utility programs for X, and miscellaneous programs with an X GUI which were placed here because they didn't fit anywhere else.")); - - section_descriptions["contrib"]=transcode(_("Programs which depend on software not in Debian\n Packages in the 'contrib' section are not part of Debian.\n .\n These packages are Free Software, but they depend on software which is not part of Debian. This may be because it is not Free Software, but is packaged in the non-free section of the archive, because Debian cannot distribute it at all, or (in rare cases) because no-one has packaged it yet.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines")); - section_descriptions["main"]=transcode(_("The main Debian archive\n The Debian distribution consists of packages from the 'main' section. Every package in 'main' is Free Software.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines")); - section_descriptions["non-US"]=transcode(_("Programs stored outside the US due to export controls\n Packages in 'non-US' likely contain cryptography; a few implement patented algorithms. Because of this, they cannot be exported from the United States, and hence are stored on a server in the \"free world\".\n .\n Note: the Debian Project is currently merging cryptographic software into the US-based archives after consulting with legal experts about recent changes in export policies. Most packages which were formerly found in this section, therefore, are now in 'main'.")); - section_descriptions["non-free"]=transcode(_("Programs which are not free software\n Packages in the 'non-free' section are not part of Debian.\n .\n These packages fail to meet one or more of the requirements of the Debian Free Software Guidelines (see below). You should read the license of programs in this section to be sure that you are allowed to use them in the way you intend.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines")); - - section_descriptions["virtual"]=transcode(_("Virtual packages\n These packages do not exist; they are names other packages use to require or provide some functionality.")); + section_descriptions["Tasks"]=cw::util::transcode(_("Packages which set up your computer to perform a particular task\n Packages in the 'Tasks' section contain no files; they merely depend upon other packages. These packages provide an easy way to select a predefined set of packages for a specialized task.")); + + section_descriptions["Unknown"]=cw::util::transcode(_("Packages with no declared section\n No section is given for these packages. Perhaps there is an error in the Packages file?")); + + section_descriptions["admin"]=cw::util::transcode(_("Administrative utilities (install software, manage users, etc)\n Packages in the 'admin' section allow you to perform administrative tasks such as installing software, managing users, configuring and monitoring your system, examining network traffic, and so on.")); + + section_descriptions["alien"]=cw::util::transcode(_("Packages converted from foreign formats (rpm, tgz, etc)\n Packages in the 'alien' section were created by the 'alien' program from a non-Debian package format such as RPM")); + section_descriptions["base"]=cw::util::transcode(_("The Debian base system\n Packages in the 'base' section are part of the initial system installation.")); + section_descriptions["comm"]=cw::util::transcode(_("Programs for faxmodems and other communication devices\n Packages in the 'comm' section are used to control modems and other hardware communications devices. This includes software to control faxmodems (for instance, PPP for dial-up internet connections and programs originally written for that purpose, such as zmodem/kermit), as well as software to control cellular phones, interface with FidoNet, and run a BBS.")); + section_descriptions["devel"]=cw::util::transcode(_("Utilities and programs for software development\n Packages in the 'devel' section are used to write new software and work on existing software. Non-programmers who do not compile their own software probably do not need much software from this section.\n .\n It includes compilers, debugging tools, programmer's editors, source processing tools, and other things related to software development.")); + section_descriptions["doc"]=cw::util::transcode(_("Documentation and specialized programs for viewing documentation\n Packages in the 'doc' section document parts of the Debian system, or are viewers for documentation formats.")); + section_descriptions["editors"]=cw::util::transcode(_("Text editors and word processors\n Packages in the 'editors' section allow you to edit plain ASCII text. These are not necessarily word processors, although some word processors may be found in this section.")); + section_descriptions["electronics"]=cw::util::transcode(_("Programs for working with circuits and electronics\n Packages in the 'electronics' section include circuit design tools, simulators and assemblers for microcontrollers, and other related software.")); + section_descriptions["embedded"]=cw::util::transcode(_("Programs for embedded systems\n Packages in the 'embedded' section are meant to run on embedded devices. Embedded devices are specialized hardware devices with much less power than a typical desktop system: for instance, a PDA, a cell phone, or a Tivo.")); + section_descriptions["gnome"]=cw::util::transcode(_("The GNOME Desktop System\n GNOME is a collection of software which provides an easy-to-use desktop environment for Linux. Packages in the 'gnome' section are part of the GNOME environment or closely integrated into it.")); + section_descriptions["games"]=cw::util::transcode(_("Games, toys, and fun programs\n Packages in the 'games' section are meant primarily for entertainment.")); + section_descriptions["graphics"]=cw::util::transcode(_("Utilities to create, view, and edit graphics files\n Packages in the 'graphics' section include viewers for image files, image processing and manipulation software, software to interact with graphics hardware (such as video cards, scanners, and digital cameras), and programming tools for handling graphics.")); + section_descriptions["hamradio"]=cw::util::transcode(_("Software for ham radio operators\n Packages in the 'hamradio' section are meant primarily for ham radio operators.")); + section_descriptions["interpreters"]=cw::util::transcode(_("Interpreters for interpreted languages\n Packages in the 'interpreters' section include interpreters for languages like Python, Perl, and Ruby, and libraries for these same languages.")); + section_descriptions["kde"]=cw::util::transcode(_("The KDE Desktop System\n KDE is a collection of software which provides an easy-to-use desktop environment for Linux. Packages in the 'kde' section are part of the KDE environment or closely integrated into it.")); + section_descriptions["libdevel"]=cw::util::transcode(_("Development files for libraries\n Packages in the 'libdevel' section contain files required for building programs that use libraries in the 'libs' section. You don't need packages from this section unless you want to compile software yourself.")); + section_descriptions["libs"]=cw::util::transcode(_("Collections of software routines\n Packages in the 'libs' section provide necessary functionality for other software on the computer. With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies.")); + section_descriptions["perl"]=cw::util::transcode(_("Perl interpreter and libraries\n Packages in the 'perl' section provide the Perl programming language and many third-party libraries for it. Unless you are a Perl programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required.")); + section_descriptions["python"]=cw::util::transcode(_("Python interpreter and libraries\n Packages in the 'python' section provide the Python programming language and many third-party libraries for it. Unless you are a Python programmer, you don't need to install packages from this section explicitly; the package system will install them if they are required.")); + section_descriptions["mail"]=cw::util::transcode(_("Programs to write, send, and route email messages\n Packages in the 'mail' section include mail readers, mail transport daemons, mailing list software, and spam filters, as well as various other software related to electronic mail.")); + section_descriptions["math"]=cw::util::transcode(_("Numeric analysis and other mathematics-related software\n Packages in the 'math' section include calculators, languages for mathematical computation (similar to Mathematica), symbolic algebra packages, and programs to visualize mathematical objects.")); + section_descriptions["misc"]=cw::util::transcode(_("Miscellaneous software\n Packages in the 'misc' section have too unusual a function to be classified.")); + section_descriptions["net"]=cw::util::transcode(_("Programs to connect to and provide various services\n Packages in the 'net' section include clients and servers for many protocols, tools to manipulate and debug low-level network protocols, IM systems, and other network-related software.")); + section_descriptions["news"]=cw::util::transcode(_("Usenet clients and servers\n Packages in the 'news' section are related to the Usenet distributed news system. They include news readers and news servers.")); + section_descriptions["oldlibs"]=cw::util::transcode(_("Obsolete libraries\n Packages in the 'oldlibs' section are obsolete and should not be used by new software. They are provided for compatibility reasons, or because software distributed by Debian still requires them.\n .\n With very few exceptions, you should not need to explicitly install a package from this section; the package system will install them as required to fulfill dependencies.")); + section_descriptions["otherosfs"]=cw::util::transcode(_("Emulators and software to read foreign filesystems\n Packages in the 'otherosfs' section emulate hardware and operating systems and provide tools for transferring data between different operating systems and hardware platforms. (for instance, utilities to read DOS floppies, and utilities to communicate with Palm Pilots)\n .\n It is worth noting that CD burning software is included in THIS section.")); + section_descriptions["science"]=cw::util::transcode(_("Software for scientific work\n Packages in the 'science' section include tools for astronomy, biology, and chemistry, as well as other science-related software.")); + section_descriptions["shells"]=cw::util::transcode(_("Command shells and alternative console environments\n Packages in the 'shells' section include programs providing a command-line interface.")); + section_descriptions["sound"]=cw::util::transcode(_("Utilities to play and record sound\n Packages in the 'sound' section include sound players, recorders, and encoders for many formats, mixers and volume controls, MIDI sequencers and programs to generate musical notation, drivers for sound hardware, and sound processing software.")); + section_descriptions["tex"]=cw::util::transcode(_("The TeX typesetting system\n Packages in the 'tex' section are related to TeX, a system for producing high-quality typeset output. They include TeX itself, TeX packages, editors designed for TeX, utilities to convert TeX and TeX output files to various formats, TeX fonts, and other software related to TeX.")); + section_descriptions["text"]=cw::util::transcode(_("Text processing utilities\n Packages in the 'text' section include text filters and processors, spelling checkers, dictionary programs, utilities to convert between character encodings and text file formats (eg, Unix and DOS), text formatters and pretty-printers, and other software which operates on plain text.")); + section_descriptions["utils"]=cw::util::transcode(_("Various system utilities\n Packages in the 'utils' section are utilities whose purpose is too unique to be classified.")); + section_descriptions["web"]=cw::util::transcode(_("Web browsers, servers, proxies, and other tools\n Packages in the 'web' section include Web browsers, Web servers and proxies, software to write CGI scripts or Web-based programs, pre-written Web-based programs, and other software related to the World Wide Web.")); + section_descriptions["x11"]=cw::util::transcode(_("The X window system and related software\n Packages in the 'x11' section include the core packages for the X window system, window managers, utility programs for X, and miscellaneous programs with an X GUI which were placed here because they didn't fit anywhere else.")); + + section_descriptions["contrib"]=cw::util::transcode(_("Programs which depend on software not in Debian\n Packages in the 'contrib' section are not part of Debian.\n .\n These packages are Free Software, but they depend on software which is not part of Debian. This may be because it is not Free Software, but is packaged in the non-free section of the archive, because Debian cannot distribute it at all, or (in rare cases) because no-one has packaged it yet.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines")); + section_descriptions["main"]=cw::util::transcode(_("The main Debian archive\n The Debian distribution consists of packages from the 'main' section. Every package in 'main' is Free Software.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines")); + section_descriptions["non-US"]=cw::util::transcode(_("Programs stored outside the US due to export controls\n Packages in 'non-US' likely contain cryptography; a few implement patented algorithms. Because of this, they cannot be exported from the United States, and hence are stored on a server in the \"free world\".\n .\n Note: the Debian Project is currently merging cryptographic software into the US-based archives after consulting with legal experts about recent changes in export policies. Most packages which were formerly found in this section, therefore, are now in 'main'.")); + section_descriptions["non-free"]=cw::util::transcode(_("Programs which are not free software\n Packages in the 'non-free' section are not part of Debian.\n .\n These packages fail to meet one or more of the requirements of the Debian Free Software Guidelines (see below). You should read the license of programs in this section to be sure that you are allowed to use them in the way you intend.\n .\n For more information about what Debian considers to be Free Software, see http://www.debian.org/social_contract#guidelines")); + + section_descriptions["virtual"]=cw::util::transcode(_("Virtual packages\n These packages do not exist; they are names other packages use to require or provide some functionality.")); already_done=true; } @@ -270,14 +270,14 @@ void pkg_grouppolicy_section::add_package(const pkgCache::PkgIterator &pkg, wstring desc=section_descriptions[realtag]; if(desc.find(L'\n')!=desc.npos) - newtree=new pkg_subtree(transcode(tag)+L" - "+wstring(desc, 0, desc.find('\n')), + newtree=new pkg_subtree(cw::util::transcode(tag)+L" - "+wstring(desc, 0, desc.find('\n')), desc, get_desc_sig()); else - newtree=new pkg_subtree(transcode(tag)+desc); + newtree=new pkg_subtree(cw::util::transcode(tag)+desc); } else - newtree=new pkg_subtree(transcode(tag)); + newtree=new pkg_subtree(cw::util::transcode(tag)); sections[tag].first=chain->instantiate(get_sig(), get_desc_sig()); sections[tag].second=newtree; @@ -386,7 +386,7 @@ void pkg_grouppolicy_status::add_package(const pkgCache::PkgIterator &pkg, if(!children[section].second) { - wstring desc=transcode(_(state_titles[section])); + wstring desc=cw::util::transcode(_(state_titles[section])); wstring shortdesc(desc, 0, desc.find('\n')); pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc, desc, @@ -463,7 +463,7 @@ public: { if(!children[group].second) { - wstring desc=transcode(_(child_names[group])); + wstring desc=cw::util::transcode(_(child_names[group])); wstring shortdesc(desc, 0, desc.find('\n')); pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc, @@ -483,7 +483,7 @@ public: { if(!recommended_child.second) { - const wstring desc=transcode(_("Packages which are recommended by other packages\n These packages are not strictly required, but they may be necessary to provide full functionality in some other programs that you are installing or upgrading.")); + const wstring desc=cw::util::transcode(_("Packages which are recommended by other packages\n These packages are not strictly required, but they may be necessary to provide full functionality in some other programs that you are installing or upgrading.")); const wstring shortdesc(desc, 0, desc.find('\n')); pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc, @@ -503,7 +503,7 @@ public: { if(!suggested_child.second) { - const wstring desc=transcode(_("Packages which are suggested by other packages\n These packages are not required in order to make your system function properly, but they may provide enhanced functionality for some programs that you are currently installing.")); + const wstring desc=cw::util::transcode(_("Packages which are suggested by other packages\n These packages are not required in order to make your system function properly, but they may provide enhanced functionality for some programs that you are currently installing.")); const wstring shortdesc(desc, 0, desc.find('\n')); pkg_subtree *newtree=new pkg_subtree_with_order(shortdesc, @@ -586,7 +586,7 @@ public: string treename; treename+=firstchar; - pkg_subtree *newtree=new pkg_subtree(transcode(treename)); + pkg_subtree *newtree=new pkg_subtree(cw::util::transcode(treename)); pkg_grouppolicy *newchild=chain->instantiate(get_sig(), get_desc_sig()); children[firstchar].first=newchild; @@ -679,7 +679,7 @@ public: default : order=6; break; }; - pkg_subtree *newtree=new pkg_subtree_with_order(transcode(buf), order); + pkg_subtree *newtree=new pkg_subtree_with_order(cw::util::transcode(buf), order); pkg_grouppolicy *newchild=chain->instantiate(get_sig(), get_desc_sig()); children[priority].first=newchild; @@ -777,7 +777,7 @@ public: { if(!uncategorized) { - uncategorized=new pkg_subtree(transcode(_("UNCATEGORIZED"))); + uncategorized=new pkg_subtree(cw::util::transcode(_("UNCATEGORIZED"))); uncategorized_policy=chain->instantiate(sig, desc_sig); root->add_child(uncategorized); } @@ -790,7 +790,7 @@ public: { nodedata *data=(nodedata *) parent_data; - pkg_subtree *newtree=new pkg_subtree(transcode(group->description)); + pkg_subtree *newtree=new pkg_subtree(cw::util::transcode(group->description)); pkg_grouppolicy *newpolicy=chain->instantiate(sig, desc_sig); nodedata *rval=new nodedata(newpolicy, newtree); @@ -896,13 +896,13 @@ void pkg_grouppolicy_task::init_section_descriptions() if(already_done) return; - task_section_descriptions.push_back(pair<string,wstring>("user", transcode(_("End-user")))); - task_section_descriptions.push_back(pair<string,wstring>("server", transcode(_("Servers")))); - task_section_descriptions.push_back(pair<string,wstring>("devel", transcode(_("Development")))); - task_section_descriptions.push_back(pair<string,wstring>("l10n", transcode(_("Localization")))); - task_section_descriptions.push_back(pair<string,wstring>("hware", transcode(_("Hardware Support")))); - task_section_descriptions.push_back(pair<string,wstring>("misc", transcode(_("Miscellaneous")))); - task_section_descriptions.push_back(pair<string,wstring>("unknown", transcode(_("Unrecognized tasks")))); + task_section_descriptions.push_back(pair<string,wstring>("user", cw::util::transcode(_("End-user")))); + task_section_descriptions.push_back(pair<string,wstring>("server", cw::util::transcode(_("Servers")))); + task_section_descriptions.push_back(pair<string,wstring>("devel", cw::util::transcode(_("Development")))); + task_section_descriptions.push_back(pair<string,wstring>("l10n", cw::util::transcode(_("Localization")))); + task_section_descriptions.push_back(pair<string,wstring>("hware", cw::util::transcode(_("Hardware Support")))); + task_section_descriptions.push_back(pair<string,wstring>("misc", cw::util::transcode(_("Miscellaneous")))); + task_section_descriptions.push_back(pair<string,wstring>("unknown", cw::util::transcode(_("Unrecognized tasks")))); } /** Uses the fact that 0<=Relevance<=10 to encode Relevance as a character. */ @@ -953,15 +953,15 @@ void pkg_grouppolicy_task::add_package(const pkgCache::PkgIterator &pkg, if(!tasks_subtree) { - tasks_subtree=new pkg_subtree(transcode(_("Tasks")), - transcode(_("\n Tasks are groups of packages which provide an easy way to select a predefined set of packages for a particular purpose.")), get_desc_sig()); + tasks_subtree=new pkg_subtree(cw::util::transcode(_("Tasks")), + cw::util::transcode(_("\n Tasks are groups of packages which provide an easy way to select a predefined set of packages for a particular purpose.")), get_desc_sig()); root->add_child(tasks_subtree); } subtree_map::iterator sectionfound=section_children.find(section); if(sectionfound==section_children.end()) { - wstring sectiondesc=transcode(section, "ASCII"); + wstring sectiondesc=cw::util::transcode(section, "ASCII"); for(desclist::iterator j=task_section_descriptions.begin(); j!=task_section_descriptions.end(); @@ -980,12 +980,12 @@ void pkg_grouppolicy_task::add_package(const pkgCache::PkgIterator &pkg, sectiontree=sectionfound->second; if(taskfound!=task_list->end()) - newtree=new task_subtree(transcode(taskfound->second.shortdesc), - transcode(taskfound->second.longdesc), + newtree=new task_subtree(cw::util::transcode(taskfound->second.shortdesc), + cw::util::transcode(taskfound->second.longdesc), get_desc_sig(), taskfound->second.relevance); else - newtree=new task_subtree(transcode(*i), L"", + newtree=new task_subtree(cw::util::transcode(*i), L"", get_desc_sig(), 5); task_children[*i]=newtree; @@ -1078,7 +1078,7 @@ private: { wchar_t buf[512]; - swprintf(buf, 512, transcode(_("Bad number in format string: %ls")).c_str(), + swprintf(buf, 512, cw::util::transcode(_("Bad number in format string: %ls")).c_str(), tocvt.c_str()); return buf; @@ -1087,7 +1087,7 @@ private: if(val < 1) { wchar_t buf[512]; - swprintf(buf, 512, transcode(_("Match indices must be 1 or greater, not \"%s\"")).c_str(), + swprintf(buf, 512, cw::util::transcode(_("Match indices must be 1 or greater, not \"%s\"")).c_str(), tocvt.c_str()); return buf; } @@ -1105,13 +1105,13 @@ private: } wchar_t buf[1024]; - swprintf(buf, 1024, transcode(_("Match index %ls is too large; available groups are (%s)")).c_str(), + swprintf(buf, 1024, cw::util::transcode(_("Match index %ls is too large; available groups are (%s)")).c_str(), tocvt.c_str(), group_values.c_str()); return buf; } - rval += transcode(res->group(val)); + rval += cw::util::transcode(res->group(val)); } } } @@ -1251,7 +1251,7 @@ public: subtree = new pkg_subtree(swsprintf(L"%s - %s", tagname.c_str(), shortdesc.c_str()), - transcode(desc), + cw::util::transcode(desc), get_desc_sig()); root->add_child(subtree); subpolicy = chain->instantiate(get_sig(), @@ -1332,8 +1332,8 @@ public: { eassert(untagged_policy == NULL); - untagged_tree = new pkg_subtree(transcode(_("TAGLESS PACKAGES")), - transcode(_("\n These packages have not yet been classified in debtags.")), + untagged_tree = new pkg_subtree(cw::util::transcode(_("TAGLESS PACKAGES")), + cw::util::transcode(_("\n These packages have not yet been classified in debtags.")), get_desc_sig()); root->add_child(untagged_tree); @@ -1377,11 +1377,11 @@ public: tagtree = new pkg_subtree(swsprintf(L"%s - %s", thisfacet.c_str(), shortdesc.c_str()), - transcode(desc), + cw::util::transcode(desc), get_desc_sig()); else - tagtree = new pkg_subtree(transcode(thisfacet), - transcode(desc), + tagtree = new pkg_subtree(cw::util::transcode(thisfacet), + cw::util::transcode(desc), get_desc_sig()); root->add_child(tagtree); tagchildren = new tagmap; @@ -1409,11 +1409,11 @@ public: subtree = new pkg_subtree(swsprintf(L"%s - %s", thistag.c_str(), shortdesc.c_str()), - transcode(desc), + cw::util::transcode(desc), get_desc_sig()); else - subtree = new pkg_subtree(transcode(thistag), - transcode(desc), + subtree = new pkg_subtree(cw::util::transcode(thistag), + cw::util::transcode(desc), get_desc_sig()); tagtree->add_child(subtree); diff --git a/src/pkg_info_screen.cc b/src/pkg_info_screen.cc index 7a3f66f8..b19e2fc6 100644 --- a/src/pkg_info_screen.cc +++ b/src/pkg_info_screen.cc @@ -134,7 +134,7 @@ void pkg_grouppolicy_info::setup_package_info(const pkgCache::PkgIterator &pkg, if(!ver.ProvidesList().end()) { snprintf(buf, 256, _("Package names provided by %s"), pkg.Name()); - pkg_subtree *prvtree=new pkg_subtree(transcode(buf)); + pkg_subtree *prvtree=new pkg_subtree(cw::util::transcode(buf)); for(pkgCache::PrvIterator prv=ver.ProvidesList(); !prv.end(); ++prv) prvtree->add_child(new pkg_item(prv.ParentPkg(), sig)); @@ -144,11 +144,11 @@ void pkg_grouppolicy_info::setup_package_info(const pkgCache::PkgIterator &pkg, } snprintf(buf, 256, _("Packages which depend on %s"), pkg.Name()); - pkg_subtree *revtree=new pkg_subtree(transcode(buf)); + pkg_subtree *revtree=new pkg_subtree(cw::util::transcode(buf)); setup_package_deps<pkg_subtree>(pkg, ver, revtree, sig, true); tree->add_child(revtree); - pkg_vertree_generic *newtree=new pkg_vertree_generic(transcode(_("Versions")), true); + pkg_vertree_generic *newtree=new pkg_vertree_generic(cw::util::transcode(_("Versions")), true); setup_package_versions(pkg, newtree, sig); tree->add_child(newtree); } diff --git a/src/pkg_item.cc b/src/pkg_item.cc index efb27ca9..c74e1fca 100644 --- a/src/pkg_item.cc +++ b/src/pkg_item.cc @@ -58,7 +58,7 @@ static void try_delete_essential(wstring s, const pkgCache::PkgIterator pkg, bool purge) { - if(s==transcode(_(confirm_str))) + if(s==cw::util::transcode(_(confirm_str))) { undo_group *grp=new apt_undo_group; @@ -300,7 +300,7 @@ style pkg_item::pkg_style(pkgCache::PkgIterator package, bool highlighted) } } -void pkg_item::paint(widgets::tree *win, int y, bool hierarchical, const style &st) +void pkg_item::paint(widgets::tree *win, int y, bool hierarchical, const cw::style const style &st) { int basex=hierarchical?2*get_depth():0; int width, height; @@ -313,7 +313,7 @@ void pkg_item::paint(widgets::tree *win, int y, bool hierarchical, const style & win->mvaddnstr(y, 0, disp.c_str(), width); } -bool pkg_item::dispatch_key(const key &k, widgets::tree *owner) +bool pkg_item::dispatch_key(const cwi::key &k, widgets::tree *owner) { if(bindings->key_matches(k, "Versions")) { @@ -455,7 +455,7 @@ bool pkg_item::dispatch_key(const key &k, widgets::tree *owner) // FIXME: better title add_main_widget(e, _("Hierarchy editor"), "", _("Hierarchy Editor")); - e->connect_key("Quit", &global_bindings, + e->connect_key("Quit", &cw::global_bindings, sigc::mem_fun(*e.unsafe_get_ref(), &cwidget::widgets::widget::destroy)); } else @@ -500,7 +500,7 @@ const wchar_t *pkg_item::tag() // FIXME: ew static wstring pkgname; - pkgname=transcode(package.Name(), "ASCII"); + pkgname=cw::util::transcode(package.Name(), "ASCII"); return pkgname.c_str(); } @@ -510,7 +510,7 @@ const wchar_t *pkg_item::label() // FIXME: ew static wstring pkgname; - pkgname=transcode(package.Name(), "ASCII"); + pkgname=cw::util::transcode(package.Name(), "ASCII"); return pkgname.c_str(); } diff --git a/src/pkg_node.cc b/src/pkg_node.cc index 10f5183e..e9aaa0d1 100644 --- a/src/pkg_node.cc +++ b/src/pkg_node.cc @@ -37,12 +37,12 @@ keybindings *pkg_tree_node::bindings=NULL; void pkg_tree_node::init_bindings() { - bindings=new keybindings(&global_bindings); + bindings=new keybindings(&cw::global_bindings); } // FIXME: add a do_action() command that takes a function pointer and does all // the extra junk below. -bool pkg_tree_node::dispatch_key(const key &k, widgets::tree *owner) +bool pkg_tree_node::dispatch_key(const cwi::key &k, widgets::tree *owner) { undo_group *grp=new apt_undo_group; diff --git a/src/pkg_subtree.cc b/src/pkg_subtree.cc index 0bf8aee5..6b510c2f 100644 --- a/src/pkg_subtree.cc +++ b/src/pkg_subtree.cc @@ -26,7 +26,7 @@ #include <cwidget/widgets/tree.h> void pkg_subtree::paint(widgets::tree *win, int y, bool hierarchical, - const style &st) + const cw::style const style &st) { widgets::subtree<pkg_tree_node>::paint(win, y, hierarchical, name); } @@ -41,7 +41,7 @@ const wchar_t *pkg_subtree::label() return name.c_str(); } -bool pkg_subtree::dispatch_key(const key &k, widgets::tree *owner) +bool pkg_subtree::dispatch_key(const cwi::key &k, widgets::tree *owner) { if(pkg_tree_node::dispatch_key(k, owner)) return true; diff --git a/src/pkg_tree.cc b/src/pkg_tree.cc index 716fc208..79ab4f10 100644 --- a/src/pkg_tree.cc +++ b/src/pkg_tree.cc @@ -68,7 +68,7 @@ pkg_tree::pkg_tree(const std::string &def_grouping, limitstr(def_limit) { if(!limitstr.empty()) - limit=parse_pattern(transcode(limitstr)); + limit=parse_pattern(cw::util::transcode(limitstr)); } pkg_tree::pkg_tree(const std::string &def_grouping, @@ -78,10 +78,10 @@ pkg_tree::pkg_tree(const std::string &def_grouping, sorting(parse_sortpolicy(aptcfg->Find(PACKAGE "::UI::Default-Sorting", "name"))), limit(NULL), - limitstr(transcode(aptcfg->Find(PACKAGE "::Pkg-Display-Limit", ""))) + limitstr(cw::util::transcode(aptcfg->Find(PACKAGE "::Pkg-Display-Limit", ""))) { if(!limitstr.empty()) - limit=parse_pattern(transcode(limitstr)); + limit=parse_pattern(cw::util::transcode(limitstr)); } void pkg_tree::handle_cache_close() @@ -112,7 +112,7 @@ void pkg_tree::set_grouping(pkg_grouppolicy_factory *_grouping) void pkg_tree::set_grouping(const std::wstring &s) { // FIXME: push wstrings down into the parsing code. - groupingstr=transcode(s); + groupingstr=cw::util::transcode(s); pkg_grouppolicy_factory *grp=parse_grouppolicy(groupingstr); @@ -134,7 +134,7 @@ void pkg_tree::set_sorting(pkg_sortpolicy *_sorting) void pkg_tree::set_sorting(const std::wstring &s) { // FIXME: push wstrings down into the parsing code. - pkg_sortpolicy *policy=parse_sortpolicy(transcode(s)); + pkg_sortpolicy *policy=parse_sortpolicy(cw::util::transcode(s)); if(policy) set_sorting(policy); @@ -163,7 +163,7 @@ bool pkg_tree::build_tree(OpProgress &progress) { bool empty=true, cache_empty=true; - pkg_subtree *mytree=new pkg_subtree(transcode(_("All Packages")), true); + pkg_subtree *mytree=new pkg_subtree(cw::util::transcode(_("All Packages")), true); pkg_grouppolicy *grouper=grouping->instantiate(&selected_signal, &selected_desc_signal); @@ -224,7 +224,7 @@ void pkg_tree::set_limit(const std::wstring &_limit) pkg_matcher *old_limit=limit; std::wstring old_limitstr=limitstr; - pkg_matcher *new_limit=parse_pattern(transcode(_limit)); + pkg_matcher *new_limit=parse_pattern(cw::util::transcode(_limit)); if(_limit.empty() || new_limit) { limit=new_limit; @@ -234,7 +234,7 @@ void pkg_tree::set_limit(const std::wstring &_limit) { wchar_t buf[512]; - swprintf(buf, 512, transcode(_("No packages matched the pattern \"%ls\".")).c_str(), + swprintf(buf, 512, cw::util::transcode(_("No packages matched the pattern \"%ls\".")).c_str(), _limit.c_str()); show_message(buf); @@ -256,7 +256,7 @@ bool pkg_tree::find_limit_enabled() bool pkg_tree::find_limit() { - prompt_string(transcode(_("Enter the new package tree limit: ")), + prompt_string(cw::util::transcode(_("Enter the new package tree limit: ")), limitstr, arg(sigc::mem_fun(*this, &pkg_tree::set_limit)), NULL, @@ -285,7 +285,7 @@ bool pkg_tree::find_reset_limit() return true; } -bool pkg_tree::handle_key(const key &k) +bool pkg_tree::handle_key(const cwi::key &k) { if(bindings->key_matches(k, "ChangePkgTreeLimit")) find_limit(); diff --git a/src/pkg_ver_item.cc b/src/pkg_ver_item.cc index fb783021..402ebfe8 100644 --- a/src/pkg_ver_item.cc +++ b/src/pkg_ver_item.cc @@ -483,7 +483,7 @@ style pkg_ver_item::get_highlighted_style() pkg_ver_item::pkg_ver_item(const pkgCache::VerIterator &_version, pkg_signal *_sig, bool _show_pkg_name) - :version(_version), version_name(transcode(version.VerStr(), "ASCII")), + :version(_version), version_name(cw::util::transcode(version.VerStr(), "ASCII")), show_pkg_name(_show_pkg_name), sig(_sig) { highlighted_changed.connect(sigc::mem_fun(this, &pkg_ver_item::do_highlighted_changed)); @@ -525,7 +525,7 @@ style pkg_ver_item::ver_style(pkgCache::VerIterator version, } void pkg_ver_item::paint(widgets::tree *win, int y, bool hierarchical, - const style &st) + const cw::style const style &st) { int basex=hierarchical?2*get_depth():0; int width, height; @@ -678,7 +678,7 @@ widgets::treeitem *pkg_ver_screen::setup_new_root(const pkgCache::PkgIterator &p return newtree; } -bool pkg_ver_item::dispatch_key(const key &k, widgets::tree *owner) +bool pkg_ver_item::dispatch_key(const cwi::key &k, widgets::tree *owner) { if(bindings->key_matches(k, "Dependencies")) { diff --git a/src/pkg_ver_item.h b/src/pkg_ver_item.h index 2ad51912..4f4e26bf 100644 --- a/src/pkg_ver_item.h +++ b/src/pkg_ver_item.h @@ -64,7 +64,7 @@ class pkg_ver_item:public pkg_tree_node { pkgCache::VerIterator version; /** Stores the name of this version to avoid problems that can arise - * with transcode(). + * with cwidget::util::transcode(). */ std::wstring version_name; diff --git a/src/pkg_view.cc b/src/pkg_view.cc index 3bf39b39..fc8ae445 100644 --- a/src/pkg_view.cc +++ b/src/pkg_view.cc @@ -109,7 +109,7 @@ public: toplevel::update(); } - void paint(const style &st) + void paint(const cw::style const style &st) { widgets::widget_ref tmpref(this); @@ -148,8 +148,8 @@ static void do_set_column_format(string key, string the_default, column_definition_list *columns=NULL; - if(!transcode(format.c_str(), wformat)) - _error->Errno("iconv", _("Couldn't transcode column definition")); + if(!cw::util::transcode(format.c_str(), wformat)) + _error->Errno("iconv", _("Couldn't cw::util::transcode column definition")); else columns=parse_columns(wformat, pkg_item::pkg_columnizer::parse_column_type, @@ -557,22 +557,22 @@ widgets::widget_ref make_package_view(list<package_view_item> &format, if(desc_sig) desc_sig->connect(sigc::mem_fun(*m.unsafe_get_ref(), &info_area_multiplex::set_description)); - mainwidget->connect_key("DescriptionDown", &global_bindings, + mainwidget->connect_key("DescriptionDown", &cw::global_bindings, sigc::mem_fun(*m.unsafe_get_ref(), &info_area_multiplex::line_down)); - mainwidget->connect_key("DescriptionUp", &global_bindings, + mainwidget->connect_key("DescriptionUp", &cw::global_bindings, sigc::mem_fun(*m.unsafe_get_ref(), &info_area_multiplex::line_up)); - mainwidget->connect_key("DescriptionCycle", &global_bindings, + mainwidget->connect_key("DescriptionCycle", &cw::global_bindings, sigc::mem_fun(*m.unsafe_get_ref(), &info_area_multiplex::cycle)); - mainwidget->connect_key("EditHier", &global_bindings, + mainwidget->connect_key("EditHier", &cw::global_bindings, sigc::mem_fun(*e.unsafe_get_ref(), &cwidget::widgets::widget::show)); - mainwidget->connect_key("EditHier", &global_bindings, + mainwidget->connect_key("EditHier", &cw::global_bindings, sigc::mem_fun(*m.unsafe_get_ref(), &cwidget::widgets::widget::show)); - mainwidget->connect_key("EditHier", &global_bindings, + mainwidget->connect_key("EditHier", &cw::global_bindings, sigc::bind(sigc::mem_fun(*rval.unsafe_get_ref(), &widgets::table::focus_widget_bare), m.weak_ref())); @@ -622,7 +622,7 @@ widgets::widget_ref make_package_view(list<package_view_item> &format, if(i->popupdownkey.size()>0) rval->connect_key(i->popupdownkey, - &global_bindings, + &cw::global_bindings, sigc::mem_fun(*i->widget.unsafe_get_ref(), &cwidget::widgets::widget::toggle_visible)); diff --git a/src/progress.cc b/src/progress.cc index 403e1adc..fe40b8ba 100644 --- a/src/progress.cc +++ b/src/progress.cc @@ -46,7 +46,7 @@ namespace } } -void progress::paint(const style &st) +void progress::paint(const cw::style const style &st) { int width=getmaxx(); @@ -58,8 +58,8 @@ void progress::paint(const style &st) percentstream << " " << truncPercent << "%"; std::string percentstr = percentstream.str(); - mvaddstr(0, 0, transcode(Op)); - mvaddstr(0, width - percentstr.size(), transcode(percentstr)); + mvaddstr(0, 0, cw::util::transcode(Op)); + mvaddstr(0, width - percentstr.size(), cw::util::transcode(percentstr)); } else erase(); diff --git a/src/solution_dialog.cc b/src/solution_dialog.cc index d35b57b0..f0bc5b13 100644 --- a/src/solution_dialog.cc +++ b/src/solution_dialog.cc @@ -186,7 +186,7 @@ widgets::widget_ref make_solution_dialog() bclose->pressed.connect(sigc::mem_fun(rval.unsafe_get_ref(), &cwidget::widgets::widget::destroy)); - rval->connect_key("ApplySolution", &global_bindings, + rval->connect_key("ApplySolution", &cw::global_bindings, sigc::bind(sigc::ptr_fun(do_apply), rval.weak_ref())); diff --git a/src/solution_fragment.cc b/src/solution_fragment.cc index 7a20916e..21d4a169 100644 --- a/src/solution_fragment.cc +++ b/src/solution_fragment.cc @@ -102,28 +102,28 @@ wstring dep_text(const pkgCache::DepIterator &d) switch(d->Type) { case pkgCache::Dep::Depends: - return swsprintf(transcode(_("%s depends upon %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s depends upon %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::PreDepends: - return swsprintf(transcode(_("%s pre-depends upon %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s pre-depends upon %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::Suggests: - return swsprintf(transcode(_("%s suggests %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s suggests %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::Recommends: - return swsprintf(transcode(_("%s recommends %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s recommends %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::Conflicts: - return swsprintf(transcode(_("%s conflicts with %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s conflicts with %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::DpkgBreaks: - return swsprintf(transcode(_("%s breaks %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s breaks %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::Replaces: - return swsprintf(transcode(_("%s replaces %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s replaces %s")).c_str(), name, targets.c_str()); case pkgCache::Dep::Obsoletes: - return swsprintf(transcode(_("%s obsoletes %s")).c_str(), + return swsprintf(cw::util::transcode(_("%s obsoletes %s")).c_str(), name, targets.c_str()); default: abort(); @@ -136,7 +136,7 @@ wstring conflict_text(const pkgCache::DepIterator &conflict, if(prv.end() || !is_conflict(conflict->Type)) return dep_text(conflict); - return swsprintf(transcode(_("%s conflicts with %s [provided by %s %s]")).c_str(), + return swsprintf(cw::util::transcode(_("%s conflicts with %s [provided by %s %s]")).c_str(), const_cast<pkgCache::DepIterator &>(conflict).ParentPkg().Name(), const_cast<pkgCache::PrvIterator &>(prv).ParentPkg().Name(), const_cast<pkgCache::PrvIterator &>(prv).OwnerPkg().Name(), diff --git a/src/solution_item.cc b/src/solution_item.cc index 2105db10..2ac11961 100644 --- a/src/solution_item.cc +++ b/src/solution_item.cc @@ -160,14 +160,14 @@ style solution_item::get_normal_style() return style(); } -bool solution_item::dispatch_key(const key &k, widgets::tree *owner) +bool solution_item::dispatch_key(const cwi::key &k, widgets::tree *owner) { - if(global_bindings.key_matches(k, "SolutionActionReject")) + if(cw::global_bindings.key_matches(k, "SolutionActionReject")) { toggle_rejected(); owner->line_down(); } - else if(global_bindings.key_matches(k, "SolutionActionApprove")) + else if(cw::global_bindings.key_matches(k, "SolutionActionApprove")) { toggle_mandated(); owner->line_down(); @@ -293,9 +293,9 @@ void solution_act_item::show_target_info() ssprintf(_("Information about %s"), pkg.Name())); } -bool solution_act_item::dispatch_key(const key &k, widgets::tree *owner) +bool solution_act_item::dispatch_key(const cwi::key &k, widgets::tree *owner) { - if(global_bindings.key_matches(k, "InfoScreen")) + if(cw::global_bindings.key_matches(k, "InfoScreen")) { show_target_info(); return true; @@ -304,7 +304,7 @@ bool solution_act_item::dispatch_key(const key &k, widgets::tree *owner) return solution_item::dispatch_key(k, owner); } -void solution_act_item::paint(widgets::tree *win, int y, bool hierarchical, const style &st) +void solution_act_item::paint(widgets::tree *win, int y, bool hierarchical, const cw::style const style &st) { unsigned int basex = hierarchical ? 2*get_depth() : 0; unsigned int width = win->getmaxx(); @@ -396,7 +396,7 @@ bool solution_act_item::view_target() -void solution_act_item_bare::paint(widgets::tree *win, int y, bool hierarchical, const style &st) +void solution_act_item_bare::paint(widgets::tree *win, int y, bool hierarchical, const cw::style const style &st) { unsigned int basex = hierarchical ? 2*get_depth() : 0; unsigned int width = win->getmaxx(); @@ -559,7 +559,7 @@ void solution_unresolved_item::unmandate() resman->unapprove_broken_dep(d); } -void solution_unresolved_item::paint(widgets::tree *win, int y, bool hierarchical, const style &st) +void solution_unresolved_item::paint(widgets::tree *win, int y, bool hierarchical, const cw::style const style &st) { unsigned int basex = hierarchical ? 2*get_depth() : 0; unsigned int width = win->getmaxx(); @@ -594,11 +594,11 @@ void solution_unresolved_item::paint(widgets::tree *win, int y, bool hierarchica wstring text; if(!fully_explained) - text = swsprintf(transcode(_("%s recommends %s")).c_str(), + text = swsprintf(cw::util::transcode(_("%s recommends %s")).c_str(), d.get_dep().ParentPkg().Name(), dep_targets(d.get_dep()).c_str()); else - text = swsprintf(transcode(_("-> Leave the dependency \"%s recommends %s\" unresolved.")).c_str(), + text = swsprintf(cw::util::transcode(_("-> Leave the dependency \"%s recommends %s\" unresolved.")).c_str(), d.get_dep().ParentPkg().Name(), dep_targets(d.get_dep()).c_str()); diff --git a/src/solution_item.h b/src/solution_item.h index 38611230..bd3664b2 100644 --- a/src/solution_item.h +++ b/src/solution_item.h @@ -80,7 +80,7 @@ public: style get_normal_style(); - bool dispatch_key(const key &k, cwidget::widgets::tree *owner); + bool dispatch_key(const cwidget::key &k, cwidget::widgets::tree *owner); // Menu redirections: bool resolver_toggle_approved(); @@ -143,9 +143,9 @@ public: return ver; } - bool dispatch_key(const key &k, cwidget::widgets::tree *owner); + bool dispatch_key(const cwidget::key &k, cwidget::widgets::tree *owner); - void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const style &st); + void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const cwidget::style const style &st); // Menu redirections. @@ -166,7 +166,7 @@ public: { } - void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const style &st); + void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const cwidget::style const style &st); }; /** A solution item corresponding to leaving a dependency unresolved. */ @@ -199,7 +199,7 @@ public: void mandate(); void unmandate(); - void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const style &st); + void paint(cwidget::widgets::tree *win, int y, bool hierarchical, const cwidget::style const style &st); }; diff --git a/src/solution_screen.cc b/src/solution_screen.cc index e4b6de3e..c1e01d56 100644 --- a/src/solution_screen.cc +++ b/src/solution_screen.cc @@ -118,7 +118,7 @@ public: } void paint(widgets::tree *win, int y, bool hierarchical, - const style &st) + const cw::style const style &st) { widgets::subtree<widgets::treeitem>::paint(win, y, hierarchical, my_label); } @@ -146,7 +146,7 @@ widgets::subtree_generic *make_dep_solvers_tree(const aptitude_resolver_dep &d) widgets::staticitem *conflict_item = new widgets::staticitem(conflict_text(real_dep, prv), L""); root->add_child(conflict_item); - widgets::subtree_generic *resolvers = new label_tree(transcode(_("The following actions will resolve this dependency:")), true, false); + widgets::subtree_generic *resolvers = new label_tree(cw::util::transcode(_("The following actions will resolve this dependency:")), true, false); root->add_child(resolvers); @@ -232,7 +232,7 @@ widgets::subtree_generic *make_solution_tree(const aptitude_solution &sol, if(!remove_actions.empty()) { - widgets::subtree_generic *remove_tree = new label_tree(transcode(_("Remove the following packages:"))); + widgets::subtree_generic *remove_tree = new label_tree(cw::util::transcode(_("Remove the following packages:"))); for(vector<aptitude_solution::action>::const_iterator i = remove_actions.begin(); i != remove_actions.end(); ++i) @@ -243,7 +243,7 @@ widgets::subtree_generic *make_solution_tree(const aptitude_solution &sol, if(!keep_actions.empty()) { - widgets::subtree_generic *keep_tree = new label_tree(transcode(_("Keep the following packages at their current version:"))); + widgets::subtree_generic *keep_tree = new label_tree(cw::util::transcode(_("Keep the following packages at their current version:"))); for(vector<aptitude_solution::action>::const_iterator i = keep_actions.begin(); i != keep_actions.end(); ++i) @@ -254,7 +254,7 @@ widgets::subtree_generic *make_solution_tree(const aptitude_solution &sol, if(!install_actions.empty()) { - widgets::subtree_generic *install_tree = new label_tree(transcode(_("Install the following packages:"))); + widgets::subtree_generic *install_tree = new label_tree(cw::util::transcode(_("Install the following packages:"))); for(vector<aptitude_solution::action>::const_iterator i = install_actions.begin(); i != install_actions.end(); ++i) @@ -265,7 +265,7 @@ widgets::subtree_generic *make_solution_tree(const aptitude_solution &sol, if(!upgrade_actions.empty()) { - widgets::subtree_generic *upgrade_tree = new label_tree(transcode(_("Upgrade the following packages:"))); + widgets::subtree_generic *upgrade_tree = new label_tree(cw::util::transcode(_("Upgrade the following packages:"))); for(vector<aptitude_solution::action>::const_iterator i = upgrade_actions.begin(); i != upgrade_actions.end(); ++i) @@ -276,7 +276,7 @@ widgets::subtree_generic *make_solution_tree(const aptitude_solution &sol, if(!downgrade_actions.empty()) { - widgets::subtree_generic *downgrade_tree = new label_tree(transcode(_("Downgrade the following packages:"))); + widgets::subtree_generic *downgrade_tree = new label_tree(cw::util::transcode(_("Downgrade the following packages:"))); for(vector<aptitude_solution::action>::const_iterator i = downgrade_actions.begin(); i != downgrade_actions.end(); ++i) @@ -289,7 +289,7 @@ widgets::subtree_generic *make_solution_tree(const aptitude_solution &sol, if(!unresolved.empty()) { - widgets::subtree_generic *unresolved_tree = new label_tree(transcode(_("Leave the following recommendations unresolved:"))); + widgets::subtree_generic *unresolved_tree = new label_tree(cw::util::transcode(_("Leave the following recommendations unresolved:"))); for(imm::set<aptitude_universe::dep>::const_iterator i = unresolved.begin(); i != unresolved.end(); ++i) @@ -421,11 +421,11 @@ protected: toplevel::post_event(new slot_event(sigc::mem_fun(this, &solution_examiner::update))); } - bool handle_key(const key &k) + bool handle_key(const cwi::key &k) { widgets::widget_ref tmpref(this); - if(global_bindings.key_matches(k, "CycleOrder")) + if(cw::global_bindings.key_matches(k, "CycleOrder")) cycle_forward(); else return widgets::multiplex::handle_key(k); @@ -448,7 +448,7 @@ public: return rval; } - void paint(const style &st) + void paint(const cw::style const style &st) { if(apt_cache_file == NULL) update(); @@ -462,14 +462,14 @@ public: if(!apt_cache_file) { - set_static_root(transcode(_("The package cache is not available."))); + set_static_root(cw::util::transcode(_("The package cache is not available."))); set_active_dep(aptitude_resolver_dep()); return; } if(!resman->resolver_exists()) { - set_static_root(transcode(_("No broken packages."))); + set_static_root(cw::util::transcode(_("No broken packages."))); set_short_description(fragf("")); set_active_dep(aptitude_resolver_dep()); return; @@ -485,7 +485,7 @@ public: if(state.solutions_exhausted && state.generated_solutions == 0) { - set_static_root(transcode(_("No resolution found."))); + set_static_root(cw::util::transcode(_("No resolution found."))); last_sol.nullify(); return; } @@ -494,16 +494,16 @@ public: { if(state.background_thread_aborted) { - set_static_root(transcode(state.background_thread_abort_msg)); + set_static_root(cw::util::transcode(state.background_thread_abort_msg)); last_sol.nullify(); return; } - wstring generation_info = swsprintf(transcode(_("open: %d; closed: %d; defer: %d; conflict: %d")).c_str(), + wstring generation_info = swsprintf(cw::util::transcode(_("open: %d; closed: %d; defer: %d; conflict: %d")).c_str(), state.open_size, state.closed_size, state.deferred_size, state.conflicts_size); - wstring msg = transcode(_("Resolving dependencies...")); + wstring msg = cw::util::transcode(_("Resolving dependencies...")); widgets::subtree_generic *sol_root = new label_tree(msg); sol_root->add_child(new widgets::layout_item(hardwrapbox(text_fragment(generation_info)))); @@ -526,7 +526,7 @@ public: last_sol = sol; if(sol.get_actions().empty()) - set_static_root(transcode(_("Internal error: unexpected null solution."))); + set_static_root(cw::util::transcode(_("Internal error: unexpected null solution."))); else { solution_tree->set_root(make_solution_tree(sol, set_short_description, set_active_dep)); @@ -577,7 +577,7 @@ widgets::widget_ref make_solution_screen() create_menu_bindings(info_tree.unsafe_get_ref(), info_tree); - info_tree->connect_key("ShowHideDescription", &global_bindings, + info_tree->connect_key("ShowHideDescription", &cw::global_bindings, sigc::mem_fun(info_tree.unsafe_get_ref(), &cwidget::widgets::widget::toggle_visible)); @@ -239,7 +239,7 @@ static fragment *apt_error_fragment() // Handles "search" dialogs for pagers static void pager_search(widgets::pager &p) { - prompt_string(transcode(_("Search for:")), + prompt_string(cw::util::transcode(_("Search for:")), p.get_last_search(), arg(sigc::mem_fun(p, &widgets::pager::search_for)), NULL, @@ -272,7 +272,7 @@ static widgets::widget_ref make_error_dialog(const widgets::text_layout_ref &lay layout->location_changed.connect(sigc::mem_fun(s.unsafe_get_ref(), &widgets::scrollbar::set_slider)); s->scrollbar_interaction.connect(sigc::mem_fun(layout.unsafe_get_ref(), &widgets::text_layout::scroll)); - return widgets::dialog_ok(t, NULL, transcode(_("Ok")), get_style("Error")); + return widgets::dialog_ok(t, NULL, cw::util::transcode(_("Ok")), get_style("Error")); } // blah, I hate C++ @@ -754,7 +754,7 @@ static widgets::widget_ref make_default_view(const menu_tree_ref &mainwidget, // FIXME: do the config lookup inside the package-view code? basic_format.push_back(package_view_item("static1", - parse_columns(transcode(aptcfg->Find(PACKAGE "::UI::Package-Header-Format", default_pkgheaderdisplay)), + parse_columns(cw::util::transcode(aptcfg->Find(PACKAGE "::UI::Package-Header-Format", default_pkgheaderdisplay)), pkg_item::pkg_columnizer::parse_column_type, pkg_item::pkg_columnizer::defaults), PACKAGE "::UI::Package-Header-Format", @@ -773,7 +773,7 @@ static widgets::widget_ref make_default_view(const menu_tree_ref &mainwidget, true)); basic_format.push_back(package_view_item("static2", - parse_columns(transcode(aptcfg->Find(PACKAGE "::UI::Package-Status-Format", default_pkgstatusdisplay)), + parse_columns(cw::util::transcode(aptcfg->Find(PACKAGE "::UI::Package-Status-Format", default_pkgstatusdisplay)), pkg_item::pkg_columnizer::parse_column_type, pkg_item::pkg_columnizer::defaults), PACKAGE "::UI::Package-Status-Format", @@ -868,7 +868,7 @@ static void do_new_flat_view_with_new_bar() pkg_grouppolicy_factory *grp = new pkg_grouppolicy_end_factory; pkg_tree_ref tree = pkg_tree::create("", grp); - tree->set_limit(transcode("!~v")); + tree->set_limit(cw::util::transcode("!~v")); add_main_widget(make_default_view(tree, &tree->selected_signal, @@ -911,7 +911,7 @@ void do_new_hier_view(OpProgress &progress) grp=parse_grouppolicy(grpstr); pkg_tree_ref tree=pkg_tree::create(grpstr.c_str(), grp); - tree->set_limit(transcode("!~v")); + tree->set_limit(cw::util::transcode("!~v")); //tree->set_hierarchical(false); add_main_widget(make_default_view(tree, @@ -984,11 +984,11 @@ static widgets::widget_ref setup_fileview(const std::string &filename, s->scrollbar_interaction.connect(sigc::mem_fun(p.unsafe_get_ref(), &widgets::pager::scroll_page)); p->scroll_top(); // Force a scrollbar update. - p->connect_key("Search", &global_bindings, + p->connect_key("Search", &cw::global_bindings, sigc::bind(sigc::ptr_fun(&pager_search), p.weak_ref())); - p->connect_key("ReSearch", &global_bindings, + p->connect_key("ReSearch", &cw::global_bindings, sigc::bind(sigc::ptr_fun(&pager_repeat_search), p.weak_ref())); - p->connect_key("RepeatSearchBack", &global_bindings, + p->connect_key("RepeatSearchBack", &cw::global_bindings, sigc::bind(sigc::ptr_fun(&pager_repeat_search_back), p.weak_ref())); t->add_widget_opts(p, 0, 0, 1, 1, @@ -1257,9 +1257,9 @@ static void check_package_trust() main_stacked->add_visible_widget(widgets::dialog_yesno(sequence_fragment(frags), arg(sigc::ptr_fun(install_or_remove_packages)), - transcode(_("Really Continue")), + cw::util::transcode(_("Really Continue")), NULL, - transcode(_("Abort Installation")), + cw::util::transcode(_("Abort Installation")), get_style("TrustWarning"), true, false), @@ -1307,7 +1307,7 @@ static void do_show_preview() } if(aptcfg->Exists(PACKAGE "::UI::Preview-Limit")) - active_preview_tree=pkg_tree::create(grpstr.c_str(), grp, transcode(aptcfg->Find(PACKAGE "::UI::Preview-Limit").c_str())); + active_preview_tree=pkg_tree::create(grpstr.c_str(), grp, cw::util::transcode(aptcfg->Find(PACKAGE "::UI::Preview-Limit").c_str())); else active_preview_tree=pkg_tree::create(grpstr.c_str(), grp); @@ -1319,7 +1319,7 @@ static void do_show_preview() active_preview->destroyed.connect(sigc::ptr_fun(reset_preview)); active_preview->connect_key("DoInstallRun", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(actually_do_package_run)); add_main_widget(active_preview, _("Preview of package installation"), _("View and/or adjust the actions that will be performed"), @@ -1394,7 +1394,7 @@ static void auto_fix_broken() catch(NoMoreTime) { show_message(fragf(_("Ran out of time while trying to resolve dependencies (press \"%s\" to try harder)"), - global_bindings.readable_keyname("NextSolution").c_str()), + cw::global_bindings.readable_keyname("NextSolution").c_str()), NULL, get_style("Error")); } @@ -1442,9 +1442,9 @@ static void actually_do_package_run() popup_widget(widgets::dialog_yesno(wrapbox(text_fragment(_("Installing/removing packages requires administrative privileges, which you currently do not have. Would you like to change to the root account?"))), arg(sigc::bind(sigc::ptr_fun(&do_su_to_root), "-i")), - transcode(_("Become root")), + cw::util::transcode(_("Become root")), arg(sigc::ptr_fun(&check_package_trust)), - transcode(_("Don't become root")), + cw::util::transcode(_("Don't become root")), get_style("Error"))); } } @@ -1571,9 +1571,9 @@ void do_update_lists() popup_widget(widgets::dialog_yesno(wrapbox(text_fragment(_("Updating the package lists requires administrative privileges, which you currently do not have. Would you like to change to the root account?"))), arg(sigc::bind(sigc::ptr_fun(&do_su_to_root), "-u")), - transcode(_("Become root")), + cw::util::transcode(_("Become root")), arg(sigc::ptr_fun(&really_do_update_lists)), - transcode(_("Don't become root")), + cw::util::transcode(_("Don't become root")), get_style("Error"))); } } @@ -2052,7 +2052,7 @@ static void handle_dump_resolver_response(const wstring &s) { if(resman != NULL && resman->resolver_exists()) { - ofstream out(transcode(s).c_str()); + ofstream out(cw::util::transcode(s).c_str()); if(!out) _error->Errno("dump_resolver", _("Unable to open %ls"), s.c_str()); @@ -2423,7 +2423,7 @@ static void do_setup_columns() static void load_options(string base, bool usetheme) { load_styles(base+"::Styles", usetheme); - load_bindings(base+"::Keybindings", &global_bindings, usetheme); + load_bindings(base+"::Keybindings", &cw::global_bindings, usetheme); load_bindings(base+"::Keybindings::EditLine", widgets::editline::bindings, usetheme); load_bindings(base+"::Keybindings::Menu", widgets::menu::bindings, usetheme); load_bindings(base+"::Keybindings::Menubar", widgets::menubar::bindings, usetheme); @@ -2444,7 +2444,7 @@ static widgets::menu_ref add_menu(widgets::menu_info *info, const std::string &n widgets::menu_ref menu=widgets::menu::create(0, 0, 0, info); - main_menu->append_item(transcode(name), menu); + main_menu->append_item(cw::util::transcode(name), menu); menu->item_highlighted.connect(sigc::bind(sigc::ptr_fun(do_show_menu_description), menu_description.weak_ref())); @@ -2461,13 +2461,13 @@ static void do_update_show_tabs(widgets::multiplex &mp) class help_bar:public widgets::label { protected: - help_bar(const wstring &txt, const style &st):widgets::label(txt, st) + help_bar(const wstring &txt, const cw::style const style &st):widgets::label(txt, st) { set_visibility(); } public: static - ref_ptr<help_bar> create(const wstring &txt, const style &st) + ref_ptr<help_bar> create(const wstring &txt, const cw::style const style &st) { ref_ptr<help_bar> rval(new help_bar(txt, st)); rval->decref(); @@ -2533,52 +2533,52 @@ void ui_init() main_menu->set_subwidget(main_stacked); main_stacked->show(); - main_stacked->connect_key_post("QuitProgram", &global_bindings, sigc::ptr_fun(do_quit)); - main_stacked->connect_key_post("Quit", &global_bindings, sigc::ptr_fun(do_destroy_visible)); + main_stacked->connect_key_post("QuitProgram", &cw::global_bindings, sigc::ptr_fun(do_quit)); + main_stacked->connect_key_post("Quit", &cw::global_bindings, sigc::ptr_fun(do_destroy_visible)); main_stacked->connect_key_post("CycleNext", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_view_next)); main_stacked->connect_key_post("CyclePrev", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_view_prev)); main_stacked->connect_key_post("DoInstallRun", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_package_run)); main_stacked->connect_key_post("UpdatePackageList", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_update_lists)); main_stacked->connect_key_post("MarkUpgradable", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_mark_upgradable)); main_stacked->connect_key_post("ForgetNewPackages", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_forget_new)); main_stacked->connect_key_post("Help", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_help_help)); main_stacked->connect_key_post("Undo", - &global_bindings, + &cw::global_bindings, sigc::hide_return(undo_undo.make_slot())); main_stacked->connect_key_post("NextSolution", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_next_solution)); main_stacked->connect_key_post("PrevSolution", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_previous_solution)); main_stacked->connect_key_post("FirstSolution", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_first_solution)); main_stacked->connect_key_post("LastSolution", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_last_solution)); main_stacked->connect_key_post("ApplySolution", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_apply_solution)); main_stacked->connect_key_post("ExamineSolution", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_examine_solution)); main_stacked->connect_key_post("DumpResolver", - &global_bindings, + &cw::global_bindings, sigc::ptr_fun(do_dump_resolver)); main_table=widgets::table::create(); @@ -2586,13 +2586,13 @@ void ui_init() main_table->show(); // FIXME: highlight the keys. - wstring menu_key=global_bindings.readable_keyname("ToggleMenuActive"), - help_key=global_bindings.readable_keyname("Help"), - quit_key=global_bindings.readable_keyname("Quit"), - update_key=global_bindings.readable_keyname("UpdatePackageList"), - install_key=global_bindings.readable_keyname("DoInstallRun"); + wstring menu_key=cw::global_bindings.readable_keyname("ToggleMenuActive"), + help_key=cw::global_bindings.readable_keyname("Help"), + quit_key=cw::global_bindings.readable_keyname("Quit"), + update_key=cw::global_bindings.readable_keyname("UpdatePackageList"), + install_key=cw::global_bindings.readable_keyname("DoInstallRun"); - wstring helptext = swsprintf(transcode(_("%ls: Menu %ls: Help %ls: Quit %ls: Update %ls: Download/Install/Remove Pkgs")).c_str(), + wstring helptext = swsprintf(cw::util::transcode(_("%ls: Menu %ls: Help %ls: Quit %ls: Update %ls: Download/Install/Remove Pkgs")).c_str(), menu_key.c_str(), help_key.c_str(), quit_key.c_str(), @@ -2723,8 +2723,8 @@ void add_main_widget(const widgets::widget_ref &w, const std::string &menuref, const std::string &menudesc, const std::string &tabdesc) { - add_main_widget(w, transcode(menuref), transcode(menudesc), - transcode(tabdesc)); + add_main_widget(w, cw::util::transcode(menuref), cw::util::transcode(menudesc), + cw::util::transcode(tabdesc)); } void insert_main_widget(const widgets::widget_ref &w, const std::wstring &menuref, @@ -2742,8 +2742,8 @@ void insert_main_widget(const widgets::widget_ref &w, const std::string &menuref const std::string &menudesc, const std::string &tabdesc) { - insert_main_widget(w, transcode(menuref), - transcode(menudesc), transcode(tabdesc)); + insert_main_widget(w, cw::util::transcode(menuref), + cw::util::transcode(menudesc), cw::util::transcode(tabdesc)); } widgets::widget_ref active_main_widget() @@ -2846,9 +2846,9 @@ gen_download_progress(bool force_noninvasive, { return gen_download_progress(force_noninvasive, list_update, - transcode(title), - transcode(longtitle), - transcode(tablabel), + cw::util::transcode(title), + cw::util::transcode(longtitle), + cw::util::transcode(tablabel), abortslot); } @@ -2874,12 +2874,12 @@ void prompt_string(const std::wstring &prompt, e->text_changed.connect(*changed_slot); e->connect_key("Cancel", - &global_bindings, + &cw::global_bindings, sigc::mem_fun(e.unsafe_get_ref(), &cwidget::widgets::widget::destroy)); if(cancel_slot) e->connect_key("Cancel", - &global_bindings, + &cw::global_bindings, *cancel_slot); main_status_multiplex->add_visible_widget(e, true); @@ -2900,7 +2900,7 @@ void prompt_string(const std::string &prompt, slotarg<sigc::slot1<void, wstring> > changed_slot, widgets::editline::history_list *history) { - prompt_string(transcode(prompt), transcode(text), + prompt_string(cw::util::transcode(prompt), cw::util::transcode(text), slot, cancel_slot, changed_slot, history); } @@ -2941,7 +2941,7 @@ void prompt_yesno(const std::wstring &prompt, nostring+=_("no_key")[0]; string yesnostring=deflt?yesstring+nostring:nostring+yesstring; - widgets::statuschoice_ref c=widgets::statuschoice::create(prompt, transcode(yesnostring)); + widgets::statuschoice_ref c=widgets::statuschoice::create(prompt, cw::util::transcode(yesnostring)); c->chosen.connect(sigc::bind(sigc::ptr_fun(&do_prompt_yesno), deflt, yesslot, @@ -2976,7 +2976,7 @@ void prompt_yesno(const std::string &prompt, slot0arg yesslot, slot0arg noslot) { - return prompt_yesno(transcode(prompt), deflt, yesslot, noslot); + return prompt_yesno(cw::util::transcode(prompt), deflt, yesslot, noslot); } class self_destructing_layout : public widgets::text_layout @@ -2991,7 +2991,7 @@ protected: } public: - bool handle_key(const key &k) + bool handle_key(const cwi::key &k) { if(!widgets::text_layout::focus_me() || !widgets::text_layout::handle_key(k)) @@ -3025,7 +3025,7 @@ public: void show_message(fragment *msg, slot0arg okslot, - const style &st) + const cw::style const style &st) { msg=wrapbox(msg); if(aptcfg->FindB(PACKAGE "::UI::Minibuf-Prompts")) @@ -3044,14 +3044,14 @@ void show_message(fragment *msg, void show_message(const std::string &msg, slot0arg okslot, - const style &st) + const cw::style const style &st) { show_message(text_fragment(msg), okslot, st); } void show_message(const std::wstring &msg, slot0arg okslot, - const style &st) + const cw::style const style &st) { show_message(text_fragment(msg), okslot, st); } @@ -224,9 +224,9 @@ cwidget::fragment *wrapbox(cwidget::fragment *contents); * utterly useless progress indication in this * case) * \param title if a new view is generated, this string is - * used as its title; it will be transcoded. + * used as its title; it will be cwidget::util::transcoded. * \param longtitle if a new view is generated, this string is - * used as its long title; it will be transcoded. + * used as its long title; it will be cwidget::util::transcoded. * \param abortslot the slot to trigger if the download is aborted. * * \return the new download manager and the download status widget. @@ -302,7 +302,7 @@ void show_message(const std::wstring &msg, * need a scrollbar on a 'reasonable' terminal); it will be * paragraph-wrapped as necessary. * - * \param msg the message to display; will be transcoded + * \param msg the message to display; will be cwidget::util::transcoded * \param okslot an optional slot to be called when the message is dismissed */ void show_message(const std::string &msg, diff --git a/src/view_changelog.cc b/src/view_changelog.cc index 257fdde0..8e96cab6 100644 --- a/src/view_changelog.cc +++ b/src/view_changelog.cc @@ -52,7 +52,7 @@ class pkg_changelog_screen : public widgets::file_pager, public menu_redirect { last_search_forwards = true; - prompt_string(transcode(_("Search for: ")), + prompt_string(cw::util::transcode(_("Search for: ")), get_last_search(), arg(sigc::mem_fun(*this, &widgets::pager::search_for)), NULL, @@ -64,7 +64,7 @@ class pkg_changelog_screen : public widgets::file_pager, public menu_redirect { last_search_forwards = false; - prompt_string(transcode(_("Search backwards for: ")), + prompt_string(cw::util::transcode(_("Search backwards for: ")), get_last_search(), arg(sigc::mem_fun(*this, &widgets::pager::search_back_for)), NULL, @@ -94,13 +94,13 @@ protected: int width = 0, int height = 0): widgets::file_pager(filename.get_name()), last_search_forwards(true) { - connect_key("Search", &global_bindings, + connect_key("Search", &cw::global_bindings, sigc::mem_fun(*this, &pkg_changelog_screen::do_search)); - connect_key("SearchBack", &global_bindings, + connect_key("SearchBack", &cw::global_bindings, sigc::mem_fun(*this, &pkg_changelog_screen::do_search_back)); - connect_key("ReSearch", &global_bindings, + connect_key("ReSearch", &cw::global_bindings, sigc::mem_fun(*this, &pkg_changelog_screen::do_repeat_search)); - connect_key("RepeatSearchBack", &global_bindings, + connect_key("RepeatSearchBack", &cw::global_bindings, sigc::mem_fun(*this, &pkg_changelog_screen::do_repeat_search_back)); } |