diff options
author | Daniel Burrows <dburrows@debian.org> | 2007-11-15 18:20:52 -0800 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2007-11-15 18:20:52 -0800 |
commit | 5e0c58f530fcbbbeca18d8268ec7d975ce6050f6 (patch) | |
tree | ed1467811f38d136fce6358c52c5a4d163877823 /src | |
parent | fc267a9f118e3c4c8d88ba726232a1644f1aa3f6 (diff) | |
download | aptitude-5e0c58f530fcbbbeca18d8268ec7d975ce6050f6.tar.gz |
Uniformly replace 'style' with 'cw::style', and fix up everything through load_grouppolicy.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmdline/cmdline_why.cc | 12 | ||||
-rw-r--r-- | src/desc_parse.cc | 2 | ||||
-rw-r--r-- | src/edit_pkg_hier.cc | 3 | ||||
-rw-r--r-- | src/load_config.cc | 28 | ||||
-rw-r--r-- | src/load_grouppolicy.cc | 1 | ||||
-rw-r--r-- | src/load_pkgview.cc | 2 | ||||
-rw-r--r-- | src/mine/cmine.cc | 24 | ||||
-rw-r--r-- | src/pkg_grouppolicy.cc | 2 | ||||
-rw-r--r-- | src/pkg_item.cc | 8 | ||||
-rw-r--r-- | src/pkg_ver_item.cc | 6 | ||||
-rw-r--r-- | src/pkg_view.h | 6 | ||||
-rw-r--r-- | src/reason_fragment.cc | 18 | ||||
-rw-r--r-- | src/solution_dialog.cc | 8 | ||||
-rw-r--r-- | src/solution_item.cc | 20 | ||||
-rw-r--r-- | src/solution_screen.cc | 2 | ||||
-rw-r--r-- | src/ui.cc | 6 |
16 files changed, 75 insertions, 73 deletions
diff --git a/src/cmdline/cmdline_why.cc b/src/cmdline/cmdline_why.cc index fca6b52e..efec0d0b 100644 --- a/src/cmdline/cmdline_why.cc +++ b/src/cmdline/cmdline_why.cc @@ -1059,12 +1059,12 @@ fragment *do_why(const std::vector<pkg_matcher *> &leaves, for(std::vector<justify_action>::const_iterator it = results.begin(); it != results.end(); ++it) { - col1_entries.push_back(hardwrapbox(style_fragment(fragf("%F\n", it->description_column1_fragment()), - it->get_style()))); - col2_entries.push_back(hardwrapbox(style_fragment(fragf("%F\n", it->description_column2_fragment()), - it->get_style()))); - col3_entries.push_back(hardwrapbox(style_fragment(fragf("%F\n", it->description_column3_fragment()), - it->get_style()))); + col1_entries.push_back(hardwrapbox(cw::style_fragment(fragf("%F\n", it->description_column1_fragment()), + it->get_style()))); + col2_entries.push_back(hardwrapbox(cw::style_fragment(fragf("%F\n", it->description_column2_fragment()), + it->get_style()))); + col3_entries.push_back(hardwrapbox(cw::style_fragment(fragf("%F\n", it->description_column3_fragment()), + it->get_style()))); } using cw::fragment_column_entry; diff --git a/src/desc_parse.cc b/src/desc_parse.cc index 2594e4ce..a8eba51b 100644 --- a/src/desc_parse.cc +++ b/src/desc_parse.cc @@ -62,7 +62,7 @@ namespace cw = cwidget; * * \param desc the string from which the description should be built. * \param level how many list indent levels have been entered; used - * to choose bullet style. + * to choose bullet cw::style. * * \param indent the number of spaces to strip from the left-hand * side of each line. If a line with less than this many spaces is diff --git a/src/edit_pkg_hier.cc b/src/edit_pkg_hier.cc index a897ce55..63e0e6a0 100644 --- a/src/edit_pkg_hier.cc +++ b/src/edit_pkg_hier.cc @@ -34,8 +34,9 @@ #include <generic/util/util.h> #include <cwidget/config/keybindings.h> -#include <cwidget/widgets/subtree.h> #include <cwidget/generic/util/transcode.h> +#include <cwidget/toplevel.h> +#include <cwidget/widgets/subtree.h> using namespace std; using namespace __gnu_cxx; diff --git a/src/load_config.cc b/src/load_config.cc index c7856107..a2303ffb 100644 --- a/src/load_config.cc +++ b/src/load_config.cc @@ -4,8 +4,8 @@ #include "aptitude.h" -#include "cwidget/config/style.h" -#include "cwidget/config/keybindings.h" +#include <cwidget/config/keybindings.h> +#include <cwidget/style.h> #include <apt-pkg/configuration.h> #include <apt-pkg/error.h> @@ -19,6 +19,8 @@ using namespace std; +namespace cw = cwidget; + static int parse_color(const string &s) { const char * const cs=s.c_str(); @@ -108,12 +110,12 @@ void load_styles(std::string group, bool use_theme) for(Configuration::Item const *i=cfg_grp->Child; i; i=i->Next) { if(!i->Value.empty()) - _error->Error(_("Invalid entry in style definition group: \"%s\""), i->Tag.c_str()); + _error->Error(_("Invalid entry in cw::style definition group: \"%s\""), i->Tag.c_str()); else if(i->Tag.empty()) - _error->Error(_("Invalid tagless entry in style definition group: \"%s\""), i->Value.c_str()); + _error->Error(_("Invalid tagless entry in cw::style definition group: \"%s\""), i->Value.c_str()); else { - style curr; + cw::style curr; for(Configuration::Item const *j=i->Child; j; j=j->Next) { @@ -130,16 +132,16 @@ void load_styles(std::string group, bool use_theme) curr.set_bg(parse_color(j->Value)); else { - void (style::*f)(attr_t)=NULL; + void (cw::style::*f)(attr_t)=NULL; if(!strcasecmp(j->Tag.c_str(), "set")) - f=&style::attrs_on; + f=&cw::style::attrs_on; else if(!strcasecmp(j->Tag.c_str(), "clear")) - f=&style::attrs_off; + f=&cw::style::attrs_off; else if(!strcasecmp(j->Tag.c_str(), "flip")) - f=&style::attrs_flip; + f=&cw::style::attrs_flip; if(!f) - _error->Error(_("Unknown style attribute %s"), + _error->Error(_("Unknown cw::style attribute %s"), j->Tag.c_str()); else (curr.*f)(parse_attrs(j->Value)); @@ -151,7 +153,7 @@ void load_styles(std::string group, bool use_theme) } } -void load_bindings(std::string group, keybindings *toload, bool use_theme) +void load_bindings(std::string group, cw::config::keybindings *toload, bool use_theme) { Configuration::Item const *cfg_grp=aptcfg->get_cfg(use_theme)->Tree(group.c_str()); @@ -168,13 +170,13 @@ void load_bindings(std::string group, keybindings *toload, bool use_theme) else { std::string::size_type split=0,newsplit; - keybinding newbinding; + cw::config::keybinding newbinding; do { newsplit=i->Value.find(',',split); string currval(i->Value, split, newsplit-split); - key k=parse_key(cw::util::transcode(currval)); + cw::config::key k = cw::config::parse_key(cw::util::transcode(currval)); if(k.ch!=(wint_t) ERR) newbinding.push_back(k); diff --git a/src/load_grouppolicy.cc b/src/load_grouppolicy.cc index 7207d632..1e8e889a 100644 --- a/src/load_grouppolicy.cc +++ b/src/load_grouppolicy.cc @@ -44,6 +44,7 @@ #include <map> using namespace std; +namespace cw = cwidget; class GroupParseException { diff --git a/src/load_pkgview.cc b/src/load_pkgview.cc index 919d0aeb..1a8641c0 100644 --- a/src/load_pkgview.cc +++ b/src/load_pkgview.cc @@ -16,6 +16,8 @@ #include <apt-pkg/error.h> +namespace cw = cwidget; + std::list<package_view_item> *load_pkgview(std::string cfggroup) { std::list<package_view_item> *rval=new std::list<package_view_item>; diff --git a/src/mine/cmine.cc b/src/mine/cmine.cc index 4d97faa8..6ebe6cb0 100644 --- a/src/mine/cmine.cc +++ b/src/mine/cmine.cc @@ -935,18 +935,18 @@ void cmine::init_bindings() using cwidget::style_bg; using cwidget::style_fg; - set_style("MineFlag", style_fg(COLOR_RED)+style_attrs_on(A_BOLD)); - set_style("MineBomb", style_fg(COLOR_RED)+style_attrs_on(A_BOLD)); - set_style("MineDetonated", style_fg(COLOR_RED)+style_attrs_on(A_BOLD)); - set_style("MineNumber1", style_fg(COLOR_WHITE)); - set_style("MineNumber2", style_fg(COLOR_GREEN)); - set_style("MineNumber3", style_fg(COLOR_CYAN)); - set_style("MineNumber4", style_fg(COLOR_MAGENTA)+style_attrs_on(A_BOLD)); - set_style("MineNumber5", style_fg(COLOR_RED)+style_attrs_on(A_BOLD)); - set_style("MineNumber6", style_attrs_on(A_BOLD)+style_fg(COLOR_CYAN)); - set_style("MineNumber7", style_attrs_on(A_BOLD)+style_fg(COLOR_GREEN)); - set_style("MineNumber8", style_attrs_on(A_BOLD)); - set_style("MineBorder", style_attrs_on(A_BOLD)); + set_style("MineFlag", cw::style_fg(COLOR_RED)+cw::style_attrs_on(A_BOLD)); + set_style("MineBomb", cw::style_fg(COLOR_RED)+cw::style_attrs_on(A_BOLD)); + set_style("MineDetonated", cw::style_fg(COLOR_RED)+cw::style_attrs_on(A_BOLD)); + set_style("MineNumber1", cw::style_fg(COLOR_WHITE)); + set_style("MineNumber2", cw::style_fg(COLOR_GREEN)); + set_style("MineNumber3", cw::style_fg(COLOR_CYAN)); + set_style("MineNumber4", cw::style_fg(COLOR_MAGENTA)+cw::style_attrs_on(A_BOLD)); + set_style("MineNumber5", cw::style_fg(COLOR_RED)+cw::style_attrs_on(A_BOLD)); + set_style("MineNumber6", cw::style_attrs_on(A_BOLD)+cw::style_fg(COLOR_CYAN)); + set_style("MineNumber7", cw::style_attrs_on(A_BOLD)+cw::style_fg(COLOR_GREEN)); + set_style("MineNumber8", cw::style_attrs_on(A_BOLD)); + set_style("MineBorder", cw::style_attrs_on(A_BOLD)); using cwidget::config::global_bindings; using cwidget::config::key; diff --git a/src/pkg_grouppolicy.cc b/src/pkg_grouppolicy.cc index a7aae8c2..704aea46 100644 --- a/src/pkg_grouppolicy.cc +++ b/src/pkg_grouppolicy.cc @@ -117,7 +117,7 @@ class pkg_grouppolicy_section:public pkg_grouppolicy int split_mode; bool passthrough; - // The descriptions are in the style used by package descriptions. + // The descriptions are in the cw::style used by package descriptions. static hash_map<string, wstring> section_descriptions; static void init_section_descriptions(); public: diff --git a/src/pkg_item.cc b/src/pkg_item.cc index 9e3616c6..da1d7e4a 100644 --- a/src/pkg_item.cc +++ b/src/pkg_item.cc @@ -86,7 +86,7 @@ static void confirm_delete_essential(const pkgCache::PkgIterator &pkg, NULL, NULL, NULL, - style_attrs_flip(A_REVERSE)); + cw::style_attrs_flip(A_REVERSE)); w->show_all(); @@ -235,19 +235,19 @@ void pkg_item::show_changelog() view_changelog(visible_version()); } -style pkg_item::get_highlight_style() +cw::style pkg_item::get_highlight_style() { return cw::treeitem::get_normal_style() + pkg_style(package, true); } -style pkg_item::get_normal_style() +cw::style pkg_item::get_normal_style() { return cw::treeitem::get_normal_style() + pkg_style(package, false); } #define MAYBE_HIGHLIGHTED(x) (highlighted ? (x "Highlighted") : (x)) -style pkg_item::pkg_style(pkgCache::PkgIterator package, bool highlighted) +cw::style pkg_item::pkg_style(pkgCache::PkgIterator package, bool highlighted) { if(package.VersionList().end()) { diff --git a/src/pkg_ver_item.cc b/src/pkg_ver_item.cc index d748d80d..5096a6f0 100644 --- a/src/pkg_ver_item.cc +++ b/src/pkg_ver_item.cc @@ -471,12 +471,12 @@ pkg_grouppolicy *pkg_grouppolicy_ver_factory::instantiate(pkg_signal *sig, return new pkg_grouppolicy_ver(sig, desc_sig); } -style pkg_ver_item::get_normal_style() +cw::style pkg_ver_item::get_normal_style() { return cw::treeitem::get_normal_style() + ver_style(version, false); } -style pkg_ver_item::get_highlighted_style() +cw::style pkg_ver_item::get_highlighted_style() { return cw::treeitem::get_normal_style() + ver_style(version, true); } @@ -491,7 +491,7 @@ pkg_ver_item::pkg_ver_item(const pkgCache::VerIterator &_version, pkg_signal *_s #define MAYBE_HIGHLIGHTED(x) (highlighted ? (x "Highlighted") : (x)) -style pkg_ver_item::ver_style(pkgCache::VerIterator version, +cw::style pkg_ver_item::ver_style(pkgCache::VerIterator version, bool highlighted) { pkgCache::PkgIterator pkg=version.ParentPkg(); diff --git a/src/pkg_view.h b/src/pkg_view.h index 73b9e5ee..9998b016 100644 --- a/src/pkg_view.h +++ b/src/pkg_view.h @@ -28,6 +28,7 @@ #define PKG_VIEW_H #include <cwidget/config/column_definition.h> +#include <cwidget/generic/util/ref_ptr.h> #include <cwidget/style.h> #include "pkg_grouppolicy.h" @@ -40,11 +41,6 @@ class pkg_grouppolicy_factory; namespace cwidget { - namespace util - { - template<typename T> class ref_ptr; - } - namespace widgets { class widget; diff --git a/src/reason_fragment.cc b/src/reason_fragment.cc index 5ac4ca0d..ed82f80f 100644 --- a/src/reason_fragment.cc +++ b/src/reason_fragment.cc @@ -28,16 +28,16 @@ fragment *depname_frag(pkgCache::DepIterator dep) switch(dep->Type) { case pkgCache::Dep::Depends: return text_fragment(_("depends on"), - style_attrs_on(A_BOLD)); + cw::style_attrs_on(A_BOLD)); case pkgCache::Dep::PreDepends: return text_fragment(_("pre-depends on"), - style_attrs_on(A_BOLD)); + cw::style_attrs_on(A_BOLD)); case pkgCache::Dep::Suggests: return text_fragment(_("suggests")); case pkgCache::Dep::Recommends: return text_fragment(_("recommends"), - style_attrs_on(A_BOLD)); + cw::style_attrs_on(A_BOLD)); case pkgCache::Dep::Conflicts: return text_fragment(_("conflicts with"), - style_attrs_on(A_BOLD)); + cw::style_attrs_on(A_BOLD)); case pkgCache::Dep::DpkgBreaks: return text_fragment(_("breaks"), - style_attrs_on(A_BOLD)); + cw::style_attrs_on(A_BOLD)); case pkgCache::Dep::Replaces: return text_fragment(_("replaces")); case pkgCache::Dep::Obsoletes: return text_fragment(_("obsoletes")); } @@ -144,7 +144,7 @@ fragment *prvfrag(pkgCache::PkgIterator pkg, { pkgCache::VerIterator &pv=provided_cand?candver:currver; - fragments.push_back(style_fragment(fragf("%s %s", + fragments.push_back(cw::style_fragment(fragf("%s %s", P->Name(), pv.VerStr()), pkg_ver_item::ver_style(pv, false))); @@ -155,7 +155,7 @@ fragment *prvfrag(pkgCache::PkgIterator pkg, for(set<pkgCache::VerIterator>::const_iterator i=providing_versions.begin(); i!=providing_versions.end(); ++i) if(i->ParentPkg()==*P) - fragments.push_back(style_fragment(fragf("%s %s", + fragments.push_back(cw::style_fragment(fragf("%s %s", P->Name(), i->VerStr()), pkg_ver_item::ver_style(*i, false))); @@ -188,7 +188,7 @@ fragment *dep_singlefrag(pkgCache::PkgIterator pkg, // it is satisfied but won't be, and "installing" if it is not // satisfied and will be. - style verstyle; + cw::style verstyle; bool matches_now=!pkg.CurrentVer().end() && _system->VS->CheckDep(pkg.CurrentVer().VerStr(), @@ -202,7 +202,7 @@ fragment *dep_singlefrag(pkgCache::PkgIterator pkg, if(matches_now) { if(matches_inst) - verstyle=style_attrs_on(A_BOLD); + verstyle=cw::style_attrs_on(A_BOLD); else verstyle=cw::get_style("PkgToRemove"); } diff --git a/src/solution_dialog.cc b/src/solution_dialog.cc index 822fdde6..bf778105 100644 --- a/src/solution_dialog.cc +++ b/src/solution_dialog.cc @@ -190,10 +190,10 @@ cw::widget_ref make_solution_dialog() sigc::bind(sigc::ptr_fun(do_apply), rval.weak_ref())); - bprev->set_bg_style(style_attrs_flip(A_REVERSE)); - bnext->set_bg_style(style_attrs_flip(A_REVERSE)); - bapply->set_bg_style(style_attrs_flip(A_REVERSE)); - bclose->set_bg_style(style_attrs_flip(A_REVERSE)); + bprev->set_bg_style(cw::style_attrs_flip(A_REVERSE)); + bnext->set_bg_style(cw::style_attrs_flip(A_REVERSE)); + bapply->set_bg_style(cw::style_attrs_flip(A_REVERSE)); + bclose->set_bg_style(cw::style_attrs_flip(A_REVERSE)); bt->add_widget_opts(bprev, 0, 0, 1, 1, diff --git a/src/solution_item.cc b/src/solution_item.cc index f2966a5d..57baa1e5 100644 --- a/src/solution_item.cc +++ b/src/solution_item.cc @@ -89,14 +89,14 @@ static fragment *action_description(const aptitude_resolver_version &ver) { case action_remove: return fragf(_("Remove %F [%s (%s)]"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD)), + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD)), pkg.CurrentVer().VerStr(), archives_text(pkg.CurrentVer()).c_str()); break; case action_install: return fragf(_("Install %F [%s (%s)]"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD)), + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD)), ver.get_ver().VerStr(), archives_text(ver.get_ver()).c_str()); break; @@ -104,13 +104,13 @@ static fragment *action_description(const aptitude_resolver_version &ver) case action_keep: if(ver.get_ver().end()) return fragf(_("Cancel the installation of %F"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD))); + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD))); else if(ver.get_package().current_version().get_ver().end()) return fragf(_("Cancel the removal of %F"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD))); + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD))); else return fragf(_("Keep %F at version %s (%s)"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD)), + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD)), ver.get_ver().VerStr(), archives_text(ver.get_ver()).c_str()); @@ -118,7 +118,7 @@ static fragment *action_description(const aptitude_resolver_version &ver) case action_upgrade: return fragf(_("Upgrade %F [%s (%s) -> %s (%s)]"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD)), + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD)), pkg.CurrentVer().VerStr(), archives_text(pkg.CurrentVer()).c_str(), ver.get_ver().VerStr(), archives_text(ver.get_ver()).c_str()); @@ -127,7 +127,7 @@ static fragment *action_description(const aptitude_resolver_version &ver) case action_downgrade: return fragf(_("Downgrade %F [%s (%s) -> %s (%s)]"), - text_fragment(pkg.Name(), style_attrs_on(A_BOLD)), + text_fragment(pkg.Name(), cw::style_attrs_on(A_BOLD)), pkg.CurrentVer().VerStr(), archives_text(pkg.CurrentVer()).c_str(), ver.get_ver().VerStr(), archives_text(ver.get_ver()).c_str()); break; @@ -150,14 +150,14 @@ const wchar_t *solution_item::label() return L""; } -style solution_item::get_normal_style() +cw::style solution_item::get_normal_style() { if(is_rejected()) return cw::get_style("SolutionActionRejected"); else if(is_mandatory()) return cw::get_style("SolutionActionApproved"); else - return style(); + return cw::style(); } bool solution_item::dispatch_key(const cw::config::key &k, cw::tree *owner) @@ -428,7 +428,7 @@ void solution_act_item_bare::paint(cw::tree *win, int y, bool hierarchical, cons ++x; } - win->apply_style(st+style_attrs_on(A_BOLD)); + win->apply_style(st+cw::style_attrs_on(A_BOLD)); aptitude_universe::version ver = get_ver(); diff --git a/src/solution_screen.cc b/src/solution_screen.cc index c17f3fa4..dc040e8d 100644 --- a/src/solution_screen.cc +++ b/src/solution_screen.cc @@ -34,7 +34,7 @@ #include <sigc++/adaptors/bind.h> -#include <cwidget/config/style.h> +#include <cwidget/config/cw::style.h> #include <cwidget/fragment.h> #include <cwidget/generic/util/transcode.h> #include <cwidget/widgets/label.h> @@ -355,7 +355,7 @@ static bool do_read_only_permission() t->focus_widget(ok); cw::frame_ref frame = cw::frame::create(t); - frame->set_bg_style(style_attrs_flip(A_REVERSE)); + frame->set_bg_style(cw::style_attrs_flip(A_REVERSE)); cw::center_ref c = cw::center::create(frame); @@ -769,7 +769,7 @@ static cw::widget_ref make_default_view(const menu_tree_ref &mainwidget, basic_format.push_back(package_view_item("main", 1, 0, 1, 1, cw::table::EXPAND | cw::table::FILL | cw::table::SHRINK, cw::table::EXPAND | cw::table::FILL | cw::table::SHRINK, - style(), + cw::style(), true)); basic_format.push_back(package_view_item("static2", @@ -787,7 +787,7 @@ static cw::widget_ref make_default_view(const menu_tree_ref &mainwidget, basic_format.push_back(package_view_item("desc", 3, 0, 1, 1, cw::table::EXPAND | cw::table::FILL | cw::table::SHRINK, cw::table::EXPAND | cw::table::FILL | cw::table::SHRINK, - style(), + cw::style(), "ShowHideDescription", "", allow_visible_desc && aptcfg->FindB(PACKAGE "::UI::Description-Visible-By-Default", true))); |