Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of DMBasicGUI by
lpc_swim_font.h
00001 /* 00002 * @brief SWIM font management 00003 * 00004 * @note 00005 * Copyright(C) NXP Semiconductors, 2012 00006 * All rights reserved. 00007 * 00008 * @par 00009 * Software that is described herein is for illustrative purposes only 00010 * which provides customers with programming information regarding the 00011 * LPC products. This software is supplied "AS IS" without any warranties of 00012 * any kind, and NXP Semiconductors and its licensor disclaim any and 00013 * all warranties, express or implied, including all implied warranties of 00014 * merchantability, fitness for a particular purpose and non-infringement of 00015 * intellectual property rights. NXP Semiconductors assumes no responsibility 00016 * or liability for the use of the software, conveys no license or rights under any 00017 * patent, copyright, mask work right, or any other intellectual property rights in 00018 * or to any products. NXP Semiconductors reserves the right to make changes 00019 * in the software without notification. NXP Semiconductors also makes no 00020 * representation or warranty that such application will be suitable for the 00021 * specified use without further testing or modification. 00022 * 00023 * @par 00024 * Permission to use, copy, modify, and distribute this software and its 00025 * documentation is hereby granted, under NXP Semiconductors' and its 00026 * licensor's relevant copyrights in the software, without fee, provided that it 00027 * is used in conjunction with NXP Semiconductors microcontrollers. This 00028 * copyright, permission, and disclaimer notice must appear in all copies of 00029 * this code. 00030 */ 00031 00032 #ifndef __LPC_SWIM_FONT_H_ 00033 #define __LPC_SWIM_FONT_H_ 00034 00035 #include "lpc_types.h" 00036 #include "lpc_swim.h" 00037 00038 #if defined(__cplusplus) 00039 extern "C" 00040 { 00041 #endif 00042 00043 /** @defgroup GUI_SWIM_FONT SWIM font manager 00044 * @ingroup GUI_SWIM 00045 * This package provides basic SWIM font management capabilities such as 00046 * font selection, text positioning, newline and window scrolling, and 00047 * text display with multiple, selectable fonts. 00048 * @{ 00049 */ 00050 00051 /** 00052 * @brief Put text at x, y (char) position on screen 00053 * @param win : Pointer to window data structure 00054 * @param text : Text string to output in window 00055 * @param x : Virtual X position of start of text 00056 * @param y : Virtual Y position of start of text 00057 * @return Nothing 00058 * @note Sets the virtual (upper left) text position in the window and 00059 * render the text string at this position. 00060 */ 00061 void swim_put_text_xy(SWIM_WINDOW_T *win, 00062 const CHAR *text, 00063 int32_t x, 00064 int32_t y); 00065 00066 /** 00067 * @brief Put text horizontally centered at y position on screen 00068 * @param win : Pointer to window data structure 00069 * @param text : Text string to output in window 00070 * @param x : Virtual X position of start of text 00071 * @param y : Virtual Y position of start of text 00072 * @return Nothing 00073 * @note Sets the virtual (upper left) text position in the window and 00074 * render the text string at this position. 00075 */ 00076 void swim_put_text_centered_win(SWIM_WINDOW_T *win, 00077 const CHAR *text, 00078 int32_t y); 00079 00080 /** 00081 * @brief Put text horizontally centered between x0 and x1 at y position on screen 00082 * @param win : Pointer to window data structure 00083 * @param text : Text string to output in window 00084 * @param x0 : Virtual X left position 00085 * @param x1 : Virtual X right position 00086 * @param y : Virtual Y position of start of text 00087 * @return Nothing 00088 * @note Sets the virtual (upper left) text position in the window and 00089 * render the text string at this position. 00090 */ 00091 void swim_put_text_centered(SWIM_WINDOW_T *win, 00092 const CHAR *text, 00093 int32_t x0, 00094 int32_t x1, 00095 int32_t y); 00096 00097 /** 00098 * @brief Sets the X, Y pixel coordinates for the next text operation 00099 * @param win : Pointer to window data structure 00100 * @param x : Virtual X position of start of text 00101 * @param y : Virtual Y position of start of text 00102 * @return Nothing 00103 */ 00104 void swim_set_xy(SWIM_WINDOW_T *win, 00105 int32_t x, 00106 int32_t y); 00107 00108 /** 00109 * @brief Returns the X, Y pixel coordinates for the next text operation 00110 * @param win : Pointer to window data structure 00111 * @param x : Address of where to return virtual X value 00112 * @param y : Address of where to return virtual X value 00113 * @return Nothing 00114 * @note The logical X and Y positions are computed by subtracting the 00115 * physical text position values by the physical minimum window 00116 * limits. 00117 */ 00118 void swim_get_xy(SWIM_WINDOW_T *win, 00119 int32_t *x, 00120 int32_t *y); 00121 00122 /** 00123 * @brief Puts a string of text in a window 00124 * @param win : Pointer to window data structure 00125 * @param text : Text string to output in window 00126 * @return Nothing 00127 * @note Each character will be routed to the swim_put_char function until 00128 * a string terminator is reached. For newline characters, a newline 00129 * will occur instead of a character output. 00130 */ 00131 void swim_put_text(SWIM_WINDOW_T *win, 00132 const CHAR *text); 00133 00134 /** 00135 * @brief Puts a string of text in a window with breaks 00136 * @param win : Pointer to window data structure 00137 * @param text : Text string to output in window 00138 * @return Nothing 00139 * @note Puts a string of text in a window, but will adjust the position of 00140 * a word if the word length exceeds the edge of the display. 00141 */ 00142 void swim_put_ltext(SWIM_WINDOW_T *win, 00143 const CHAR *text); 00144 00145 /** 00146 * @brief Scrolls the window up one line 00147 * @param win : Pointer to window data structure 00148 * @param lines : Number of lines to scroll up 00149 * @return Nothing 00150 */ 00151 void swim_window_scroll(SWIM_WINDOW_T *win, 00152 int32_t lines); 00153 00154 /** 00155 * @brief Puts a single character in the window 00156 * @param win : Pointer to window data structure 00157 * @param textchar : Character to print 00158 * @return Nothing 00159 * @note The character is placed at the end of the last text operation 00160 * or the current text X, Y position. 00161 */ 00162 void swim_put_char(SWIM_WINDOW_T *win, 00163 const CHAR textchar); 00164 00165 /** 00166 * @brief Puts a newline in the window 00167 * @param win : Pointer to window data structure 00168 * @return Nothing 00169 */ 00170 void swim_put_newline(SWIM_WINDOW_T *win); 00171 00172 /** 00173 * @brief Sets the active font 00174 * @param win : Pointer to window data structure 00175 * @param font : Pointer to font data structure to use for font 00176 * @return Nothing 00177 */ 00178 void swim_set_font(SWIM_WINDOW_T *win, 00179 FONT_T *font); 00180 00181 /** 00182 * @brief Returns the active font's height in pixels 00183 * @param win : Pointer to window data structure 00184 * @return The height of the current font in pixels 00185 */ 00186 int16_t swim_get_font_height(SWIM_WINDOW_T *win); 00187 00188 /** 00189 * @brief Returns the width and height of the string rendered with the active font 00190 * @param win : Pointer to window data structure 00191 * @param text : Text to render 00192 * @param width : Width of text in pixels 00193 * @param height : Height of text in pixels 00194 * @return Nothing 00195 */ 00196 void swim_get_string_bounds(SWIM_WINDOW_T *win, const CHAR * text, int* width, int* height); 00197 00198 /** 00199 * @brief Creates a title bar for the window 00200 * @param win : Pointer to window data structure 00201 * @param title : Text for title bard 00202 * @param ttlbkcolor : Totle bar backgorund color 00203 * @return Nothing 00204 * @note Creates a title bar in the window and adjusts the client 00205 * area to be outside the title bar area. 00206 */ 00207 void swim_set_title(SWIM_WINDOW_T *win, 00208 const CHAR *title, 00209 COLOR_T ttlbkcolor); 00210 00211 /** 00212 * @brief Enables and disables font backgrounds 00213 * @param win : Pointer to window data structure 00214 * @param trans : 1 for transparent backgrounds, 0 for solid color 00215 * @return Nothing 00216 * @note Enables and disables font backgrounds. When set, the font background 00217 * will not be drawn in the background color (useful for painting text 00218 * over pictures). 00219 */ 00220 void swim_set_font_transparency(SWIM_WINDOW_T *win, int32_t trans); 00221 00222 #if defined(__cplusplus) 00223 } 00224 #endif 00225 00226 /** 00227 * @} 00228 */ 00229 00230 #endif /* __LPC_SWIM_FONT_H_ */ 00231
Generated on Wed Jul 13 2022 03:01:50 by
1.7.2
