INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

colourtext.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2007-current Alex Brooks, Alex Makarenko
00005  *
00006  * This distribution is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef HYDRO_COLOUR_TEXT_H
00012 #define HYDRO_COLOUR_TEXT_H
00013 
00014 #include <string>
00015 
00016 namespace hydroctext {
00017 
00019 
00021 enum Attribute {
00023     Bold             = 1,
00025     Dim              = 2,
00027     Underline        = 4,
00029     Blink            = 5,
00031     Reverse          = 7,
00033     NormalAttributes = 22
00034 };
00035     
00037 enum Colour {
00039     Black         = 0,
00041     Red           = 1,
00043     Green         = 2,
00045     Yellow        = 3,
00047     Blue          = 4,
00049     Magenta       = 5,
00051     Cyan          = 6,
00053     White         = 7,
00055     DefaultColour = 9
00056 };
00057 
00059 struct Style
00060 {
00062     Style( Attribute a=NormalAttributes, Colour f=DefaultColour, Colour b=DefaultColour ) :
00063         attr(a),
00064         fg(f),
00065         bg(b) {};
00067     Attribute attr;
00069     Colour fg;
00071     Colour bg;
00072 };
00073 
00075 
00077 std::string reset();
00078 
00082 std::string set( Attribute attr=NormalAttributes, Colour fg=DefaultColour, Colour bg=DefaultColour );
00083 
00085 std::string set( const Style& style );
00086 
00091 std::string emph( const std::string& s, const Style& emph );
00092 
00096 std::string emph( const std::string& s, const Style& emph, const Style& main );
00097 
00100 std::string toFixedWidth( const std::string &s, int length );
00101 
00102 } // namespace
00103 
00104 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5