NIBO Library  2.11
nibocc/graphicdisplay.hpp
gehe zur Dokumentation dieser Datei
00001 /*  BSD-License:
00002 
00003 Copyright (c) 2007 by Nils Springob, nicai-systems, Germany
00004 
00005 All rights reserved.
00006 
00007 Redistribution and use in source and binary forms, with or without modification,
00008 are permitted provided that the following conditions are met:
00009 
00010   * Redistributions of source code must retain the above copyright notice,
00011     this list of conditions and the following disclaimer.
00012   * Redistributions in binary form must reproduce the above copyright notice,
00013     this list of conditions and the following disclaimer in the documentation
00014     and/or other materials provided with the distribution.
00015   * Neither the name nicai-systems nor the names of its contributors may be
00016     used to endorse or promote products derived from this software without
00017     specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00022 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00023 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00024 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00025 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00027 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00028 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030 
00031 */
00032 
00039 #ifndef NIBOCC_GRAPHICDISPLAY_HPP_
00040 #define NIBOCC_GRAPHICDISPLAY_HPP_
00041 #if defined(NIBOCC_USE_GRAPHICDISPLAY) || defined (DOXYGEN)
00042 
00043 #include <stdint.h>
00044 #include <utilscc/string.hpp>
00045 #include "nibo/gfx.h"
00046 
00047 namespace nibocc {
00048 
00052 class Bitmap
00053 {
00054   public:
00055     uint8_t width;
00056     uint8_t height;
00057     uint8_t data[];
00058 };
00059 
00060 
00064 class Graphicdisplay
00065 {
00066   public:
00067     enum
00068     {
00069       DM_JAM1 = ::GFX_DM_JAM1,
00070       DM_JAM2 = ::GFX_DM_JAM2,
00071       DM_COMP = ::GFX_DM_COMP,
00072       DM_JAM1_INV = ::GFX_DM_JAM1_INV,
00073       DM_JAM2_INV = ::GFX_DM_JAM2_INV,
00074       DM_COMP_INV = ::GFX_DM_COMP_INV
00075     };
00076 
00081     static void init() {::gfx_init();}
00082 
00086     static uint8_t get_x() {return ::gfx_get_x();}
00087 
00091     static uint8_t get_y() {return ::gfx_get_y();}
00092 
00098     static void move(uint8_t x, uint8_t y) {::gfx_move(x, y);}
00099 
00104     static void draw_mode(uint8_t mode) {::gfx_draw_mode(mode);}
00105 
00110     static void fill(uint8_t val) {::gfx_fill(val);}
00111 
00117     static uint8_t char_width(char ch) {return ::gfx_char_width(ch);}
00118 
00124     static uint8_t text_width(const char *txt) {return ::gfx_text_width(txt);}
00125 
00131     static uint8_t text_width(const ::utilscc::string & txt) {return ::gfx_text_width(txt.c_str());}
00132 
00137     static void print_char(char c) {::gfx_print_char(c);}
00138 
00143     static void print_text(const char *txt) {::gfx_print_text(txt);}
00144 
00149     static void print_text(const ::utilscc::string & txt) {::gfx_print_text(txt.c_str());}
00150 
00151 
00155     static void draw_bitmap(bitmap_t * bmp) {::gfx_draw_bitmap(bmp);}
00156 
00161     static void set_proportional(uint8_t prop) {::gfx_set_proportional(prop);}
00162 
00167     static uint8_t get_proportional() {return ::gfx_get_proportional();}
00168 
00169 };
00170 
00171 } // namespace
00172 #endif // NIBOCC_USE_GRAPHICDISPLAY
00173 #endif // NIBOCC_GRAPHICDISPLAY_HPP_
00174 

Erzeugt am Fre Jun 3 2011 15:48:39 für NIBO Library von doxygen 1.7.4-20110426