From 3780f1d8de0d2e19810a2554099f636ad22d7832 Mon Sep 17 00:00:00 2001 From: Ciaran McCreesh Date: Tue, 17 Aug 2010 13:58:12 +0100 Subject: formats -> colours --- src/clients/cave/Makefile.am | 2 +- src/clients/cave/cmd_contents.cc | 2 +- src/clients/cave/cmd_display_resolution.cc | 2 +- src/clients/cave/cmd_executables.cc | 2 +- src/clients/cave/cmd_execute_resolution.cc | 2 +- src/clients/cave/cmd_fix_cache.cc | 2 +- src/clients/cave/cmd_info.cc | 2 +- src/clients/cave/cmd_owner.cc | 2 +- src/clients/cave/cmd_report.cc | 2 +- src/clients/cave/cmd_resume.cc | 2 +- src/clients/cave/cmd_show.cc | 2 +- src/clients/cave/cmd_sync.cc | 2 +- src/clients/cave/cmd_verify.cc | 2 +- src/clients/cave/colour_formatter.cc | 2 +- src/clients/cave/colours.cc | 138 +++++++++++++++++++++++++++++ src/clients/cave/colours.hh | 53 +++++++++++ src/clients/cave/formats.cc | 138 ----------------------------- src/clients/cave/formats.hh | 53 ----------- 18 files changed, 205 insertions(+), 205 deletions(-) create mode 100644 src/clients/cave/colours.cc create mode 100644 src/clients/cave/colours.hh delete mode 100644 src/clients/cave/formats.cc delete mode 100644 src/clients/cave/formats.hh diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am index 29f6bce29..e423accf3 100644 --- a/src/clients/cave/Makefile.am +++ b/src/clients/cave/Makefile.am @@ -159,13 +159,13 @@ libcave_a_SOURCES = \ cmd_uninstall.cc cmd_uninstall.hh \ cmd_update_world.cc cmd_update_world.hh \ cmd_verify.cc cmd_verify.hh cmd_verify-fmt.hh \ + colours.cc colours.hh \ exceptions.cc exceptions.hh \ executables_common.cc executables_common.hh \ format_plain_contents_entry.cc format_plain_contents_entry.hh \ format_plain_metadata_key.cc format_plain_metadata_key.hh \ format_string.cc format_string.hh \ format_user_config.cc format_user_config.hh \ - formats.cc formats.hh \ script_command.cc script_command.hh \ search_extras_handle.cc search_extras_handle.hh \ select_format_for_spec.cc select_format_for_spec.hh \ diff --git a/src/clients/cave/cmd_contents.cc b/src/clients/cave/cmd_contents.cc index 00f2c4e30..6f772a845 100644 --- a/src/clients/cave/cmd_contents.cc +++ b/src/clients/cave/cmd_contents.cc @@ -19,7 +19,7 @@ #include "cmd_contents.hh" #include "format_user_config.hh" -#include "formats.hh" +#include "colours.hh" #include "exceptions.hh" #include #include diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc index 316405859..22bb347e1 100644 --- a/src/clients/cave/cmd_display_resolution.cc +++ b/src/clients/cave/cmd_display_resolution.cc @@ -21,7 +21,7 @@ #include "cmd_resolve_cmdline.hh" #include "exceptions.hh" #include "command_command_line.hh" -#include "formats.hh" +#include "colours.hh" #include "colour_formatter.hh" #include #include diff --git a/src/clients/cave/cmd_executables.cc b/src/clients/cave/cmd_executables.cc index 918582ed0..3b08eb761 100644 --- a/src/clients/cave/cmd_executables.cc +++ b/src/clients/cave/cmd_executables.cc @@ -21,7 +21,7 @@ #include "cmd_executables.hh" #include "command_command_line.hh" #include "executables_common.hh" -#include "formats.hh" +#include "colours.hh" #include "format_user_config.hh" #include diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc index d519529cb..d2577dc36 100644 --- a/src/clients/cave/cmd_execute_resolution.cc +++ b/src/clients/cave/cmd_execute_resolution.cc @@ -22,7 +22,7 @@ #include "cmd_perform.hh" #include "exceptions.hh" #include "command_command_line.hh" -#include "formats.hh" +#include "colours.hh" #include "colour_formatter.hh" #include "resume_data.hh" #include diff --git a/src/clients/cave/cmd_fix_cache.cc b/src/clients/cave/cmd_fix_cache.cc index 61ae0b43d..da1edefac 100644 --- a/src/clients/cave/cmd_fix_cache.cc +++ b/src/clients/cave/cmd_fix_cache.cc @@ -18,7 +18,7 @@ */ #include "cmd_fix_cache.hh" -#include "formats.hh" +#include "colours.hh" #include "format_user_config.hh" #include diff --git a/src/clients/cave/cmd_info.cc b/src/clients/cave/cmd_info.cc index 18d025ce0..745196bf1 100644 --- a/src/clients/cave/cmd_info.cc +++ b/src/clients/cave/cmd_info.cc @@ -20,7 +20,7 @@ #include "cmd_info.hh" #include "cmd_perform.hh" #include "colour_formatter.hh" -#include "formats.hh" +#include "colours.hh" #include "exceptions.hh" #include "format_user_config.hh" diff --git a/src/clients/cave/cmd_owner.cc b/src/clients/cave/cmd_owner.cc index aa86d1a57..82abc7f20 100644 --- a/src/clients/cave/cmd_owner.cc +++ b/src/clients/cave/cmd_owner.cc @@ -21,7 +21,7 @@ #include "cmd_owner.hh" #include "command_command_line.hh" #include "owner_common.hh" -#include "formats.hh" +#include "colours.hh" #include "format_user_config.hh" #include diff --git a/src/clients/cave/cmd_report.cc b/src/clients/cave/cmd_report.cc index 9ea49f0aa..61aac55f4 100644 --- a/src/clients/cave/cmd_report.cc +++ b/src/clients/cave/cmd_report.cc @@ -20,7 +20,7 @@ #include "cmd_report.hh" #include "colour_formatter.hh" #include "format_user_config.hh" -#include "formats.hh" +#include "colours.hh" #include "exceptions.hh" #include diff --git a/src/clients/cave/cmd_resume.cc b/src/clients/cave/cmd_resume.cc index 006360b9a..49478caad 100644 --- a/src/clients/cave/cmd_resume.cc +++ b/src/clients/cave/cmd_resume.cc @@ -22,7 +22,7 @@ #include "cmd_execute_resolution.hh" #include "exceptions.hh" #include "command_command_line.hh" -#include "formats.hh" +#include "colours.hh" #include "colour_formatter.hh" #include "resume_data.hh" #include diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc index 32d4ed0da..abac63760 100644 --- a/src/clients/cave/cmd_show.cc +++ b/src/clients/cave/cmd_show.cc @@ -19,7 +19,7 @@ #include "cmd_show.hh" #include "colour_formatter.hh" -#include "formats.hh" +#include "colours.hh" #include "exceptions.hh" #include "select_format_for_spec.hh" #include "format_user_config.hh" diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc index b5e0b3f13..c12a848c4 100644 --- a/src/clients/cave/cmd_sync.cc +++ b/src/clients/cave/cmd_sync.cc @@ -19,7 +19,7 @@ #include "cmd_sync.hh" #include "exceptions.hh" -#include "formats.hh" +#include "colours.hh" #include "format_user_config.hh" #include #include diff --git a/src/clients/cave/cmd_verify.cc b/src/clients/cave/cmd_verify.cc index 5a93fc691..2910fb7a2 100644 --- a/src/clients/cave/cmd_verify.cc +++ b/src/clients/cave/cmd_verify.cc @@ -19,7 +19,7 @@ #include "cmd_verify.hh" #include "format_user_config.hh" -#include "formats.hh" +#include "colours.hh" #include "exceptions.hh" #include diff --git a/src/clients/cave/colour_formatter.cc b/src/clients/cave/colour_formatter.cc index ae36b3d6a..2ecca5033 100644 --- a/src/clients/cave/colour_formatter.cc +++ b/src/clients/cave/colour_formatter.cc @@ -18,7 +18,7 @@ */ #include "colour_formatter.hh" -#include "formats.hh" +#include "colours.hh" #include "format_user_config.hh" #include #include diff --git a/src/clients/cave/colours.cc b/src/clients/cave/colours.cc new file mode 100644 index 000000000..87b61d941 --- /dev/null +++ b/src/clients/cave/colours.cc @@ -0,0 +1,138 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh + * + * This file is part of the Paludis package manager. Paludis is free software; + * you can redistribute it and/or modify it under the terms of the GNU General + * Public License version 2, as published by the Free Software Foundation. + * + * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "colours.hh" +#include "format_user_config.hh" +#include "config.h" + +using namespace paludis; +using namespace cave; + +const std::string +paludis::cave::c::bold_blue() +{ + return FormatUserConfigFile::get_instance()->fetch("bold_blue", 0, ""); +} + +const std::string +paludis::cave::c::blue() +{ + return FormatUserConfigFile::get_instance()->fetch("blue", 0, ""); +} + +const std::string +paludis::cave::c::bold_green() +{ + return FormatUserConfigFile::get_instance()->fetch("bold_green", 0, ""); +} + +const std::string +paludis::cave::c::green() +{ + return FormatUserConfigFile::get_instance()->fetch("green", 0, ""); +} + +const std::string +paludis::cave::c::red() +{ + return FormatUserConfigFile::get_instance()->fetch("red", 0, ""); +} + +const std::string +paludis::cave::c::bold_red() +{ + return FormatUserConfigFile::get_instance()->fetch("bold_red", 0, ""); +} + +const std::string +paludis::cave::c::yellow() +{ + return FormatUserConfigFile::get_instance()->fetch("yellow", 0, ""); +} + +const std::string +paludis::cave::c::bold_yellow() +{ + return FormatUserConfigFile::get_instance()->fetch("bold_yellow", 0, ""); +} + +const std::string +paludis::cave::c::pink() +{ + return FormatUserConfigFile::get_instance()->fetch("pink", 0, ""); +} + +const std::string +paludis::cave::c::bold_pink() +{ + return FormatUserConfigFile::get_instance()->fetch("bold_pink", 0, ""); +} + +const std::string +paludis::cave::c::bold_blue_or_pink() +{ +#if PALUDIS_COLOUR_PINK + return c::bold_pink(); +#else + return c::bold_blue(); +#endif +} + +const std::string +paludis::cave::c::blue_or_pink() +{ +#if PALUDIS_COLOUR_PINK + return c::pink(); +#else + return c::blue(); +#endif +} + +const std::string +paludis::cave::c::bold_green_or_pink() +{ +#if PALUDIS_COLOUR_PINK + return c::bold_pink(); +#else + return c::bold_green(); +#endif +} + +const std::string +paludis::cave::c::green_or_pink() +{ +#if PALUDIS_COLOUR_PINK + return c::pink(); +#else + return c::green(); +#endif +} + +const std::string +paludis::cave::c::normal() +{ + return FormatUserConfigFile::get_instance()->fetch("normal", 0, ""); +} + +const std::string +paludis::cave::c::bold_normal() +{ + return FormatUserConfigFile::get_instance()->fetch("bold_normal", 0, ""); +} + diff --git a/src/clients/cave/colours.hh b/src/clients/cave/colours.hh new file mode 100644 index 000000000..28b7b485f --- /dev/null +++ b/src/clients/cave/colours.hh @@ -0,0 +1,53 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh + * + * This file is part of the Paludis package manager. Paludis is free software; + * you can redistribute it and/or modify it under the terms of the GNU General + * Public License version 2, as published by the Free Software Foundation. + * + * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PALUDIS_GUARD_SRC_CLIENTS_CAVE_COLOURS_HH +#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_COLOURS_HH 1 + +#include + +namespace paludis +{ + namespace cave + { + namespace c + { + const std::string bold_blue(); + const std::string blue(); + const std::string bold_green(); + const std::string green(); + const std::string bold_red(); + const std::string red(); + const std::string bold_yellow(); + const std::string yellow(); + const std::string bold_pink(); + const std::string pink(); + + const std::string bold_blue_or_pink(); + const std::string blue_or_pink(); + const std::string bold_green_or_pink(); + const std::string green_or_pink(); + + const std::string bold_normal(); + const std::string normal(); + } + } +} + +#endif diff --git a/src/clients/cave/formats.cc b/src/clients/cave/formats.cc deleted file mode 100644 index ef2571dfb..000000000 --- a/src/clients/cave/formats.cc +++ /dev/null @@ -1,138 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "formats.hh" -#include "format_user_config.hh" -#include "config.h" - -using namespace paludis; -using namespace cave; - -const std::string -paludis::cave::c::bold_blue() -{ - return FormatUserConfigFile::get_instance()->fetch("bold_blue", 0, ""); -} - -const std::string -paludis::cave::c::blue() -{ - return FormatUserConfigFile::get_instance()->fetch("blue", 0, ""); -} - -const std::string -paludis::cave::c::bold_green() -{ - return FormatUserConfigFile::get_instance()->fetch("bold_green", 0, ""); -} - -const std::string -paludis::cave::c::green() -{ - return FormatUserConfigFile::get_instance()->fetch("green", 0, ""); -} - -const std::string -paludis::cave::c::red() -{ - return FormatUserConfigFile::get_instance()->fetch("red", 0, ""); -} - -const std::string -paludis::cave::c::bold_red() -{ - return FormatUserConfigFile::get_instance()->fetch("bold_red", 0, ""); -} - -const std::string -paludis::cave::c::yellow() -{ - return FormatUserConfigFile::get_instance()->fetch("yellow", 0, ""); -} - -const std::string -paludis::cave::c::bold_yellow() -{ - return FormatUserConfigFile::get_instance()->fetch("bold_yellow", 0, ""); -} - -const std::string -paludis::cave::c::pink() -{ - return FormatUserConfigFile::get_instance()->fetch("pink", 0, ""); -} - -const std::string -paludis::cave::c::bold_pink() -{ - return FormatUserConfigFile::get_instance()->fetch("bold_pink", 0, ""); -} - -const std::string -paludis::cave::c::bold_blue_or_pink() -{ -#if PALUDIS_COLOUR_PINK - return c::bold_pink(); -#else - return c::bold_blue(); -#endif -} - -const std::string -paludis::cave::c::blue_or_pink() -{ -#if PALUDIS_COLOUR_PINK - return c::pink(); -#else - return c::blue(); -#endif -} - -const std::string -paludis::cave::c::bold_green_or_pink() -{ -#if PALUDIS_COLOUR_PINK - return c::bold_pink(); -#else - return c::bold_green(); -#endif -} - -const std::string -paludis::cave::c::green_or_pink() -{ -#if PALUDIS_COLOUR_PINK - return c::pink(); -#else - return c::green(); -#endif -} - -const std::string -paludis::cave::c::normal() -{ - return FormatUserConfigFile::get_instance()->fetch("normal", 0, ""); -} - -const std::string -paludis::cave::c::bold_normal() -{ - return FormatUserConfigFile::get_instance()->fetch("bold_normal", 0, ""); -} - diff --git a/src/clients/cave/formats.hh b/src/clients/cave/formats.hh deleted file mode 100644 index aa403cfc0..000000000 --- a/src/clients/cave/formats.hh +++ /dev/null @@ -1,53 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef PALUDIS_GUARD_SRC_CLIENTS_CAVE_FORMATS_HH -#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_FORMATS_HH 1 - -#include - -namespace paludis -{ - namespace cave - { - namespace c - { - const std::string bold_blue(); - const std::string blue(); - const std::string bold_green(); - const std::string green(); - const std::string bold_red(); - const std::string red(); - const std::string bold_yellow(); - const std::string yellow(); - const std::string bold_pink(); - const std::string pink(); - - const std::string bold_blue_or_pink(); - const std::string blue_or_pink(); - const std::string bold_green_or_pink(); - const std::string green_or_pink(); - - const std::string bold_normal(); - const std::string normal(); - } - } -} - -#endif -- cgit v1.2.3