diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/button.c | 43 | ||||
-rw-r--r-- | src/gwin/console.c | 54 | ||||
-rw-r--r-- | src/gwin/graph.c | 74 |
3 files changed, 2 insertions, 169 deletions
diff --git a/src/gwin/button.c b/src/gwin/button.c index 9a06f4fe..8a904d95 100644 --- a/src/gwin/button.c +++ b/src/gwin/button.c @@ -131,22 +131,6 @@ static void gwinButtonCallback(void *param, GEvent *pe) { #undef gh
}
-/**
- * @brief Create a button window.
- * @return NULL if there is no resultant drawing area, otherwise a window handle.
- *
- * @param[in] gb The GButtonObject structure to initialise. If this is NULL the structure is dynamically allocated.
- * @param[in] x,y The screen co-ordinates for the bottom left corner of the window
- * @param[in] width The width of the window
- * @param[in] height The height of the window
- * @param[in] font The font to use
- * @param[in] type The type of button
- * @note The drawing color gets set to White and the background drawing color to Black.
- * @note The dimensions and position may be changed to fit on the real screen.
- * @note The button is not automatically drawn. Call gwinButtonDraw() after changing the button style or setting the text.
- *
- * @api
- */
GHandle gwinCreateButton(GButtonObject *gb, coord_t x, coord_t y, coord_t width, coord_t height, font_t font, GButtonType type) {
if (!(gb = (GButtonObject *)_gwinInit((GWindowObject *)gb, x, y, width, height, sizeof(GButtonObject))))
return 0;
@@ -161,16 +145,6 @@ GHandle gwinCreateButton(GButtonObject *gb, coord_t x, coord_t y, coord_t width, return (GHandle)gb;
}
-/**
- * @brief Set the style of a button.
- * @details The button style is defined by its shape and colours.
- *
- * @param[in] gh The window handle (must be a button window)
- * @param[in] style The button style to set.
- * @note The button is not automatically redrawn. Call gwinButtonDraw() after changing the button style
- *
- * @api
- */
void gwinSetButtonStyle(GHandle gh, const GButtonStyle *style) {
#define gbw ((GButtonObject *)gh)
if (gh->type != GW_BUTTON)
@@ -186,16 +160,6 @@ void gwinSetButtonStyle(GHandle gh, const GButtonStyle *style) { #undef gbw
}
-/**
- * @brief Set the text of a button.
- *
- * @param[in] gh The window handle (must be a button window)
- * @param[in] txt The button text to set. This must be a constant string unless useAlloc is set.
- * @param[in] useAlloc If TRUE the string specified will be copied into dynamically allocated memory.
- * @note The button is not automatically redrawn. Call gwinButtonDraw() after changing the button text.
- *
- * @api
- */
void gwinSetButtonText(GHandle gh, const char *txt, bool_t useAlloc) {
#define gbw ((GButtonObject *)gh)
if (gh->type != GW_BUTTON)
@@ -224,13 +188,6 @@ void gwinSetButtonText(GHandle gh, const char *txt, bool_t useAlloc) { #undef gbw
}
-/**
- * @brief Redraw the button.
- *
- * @param[in] gh The window handle (must be a button window)
- *
- * @api
- */
void gwinButtonDraw(GHandle gh) {
color_t cedge;
color_t cfill;
diff --git a/src/gwin/console.c b/src/gwin/console.c index 0297da30..9be7ee34 100644 --- a/src/gwin/console.c +++ b/src/gwin/console.c @@ -70,24 +70,6 @@ static const struct GConsoleWindowVMT_t GWindowConsoleVMT = { GWinStreamReadTimed
};
-/**
- * @brief Create a console window.
- * @details A console window allows text to be written using chprintf() (and the console functions defined here).
- * @brief Text in a console window supports newlines and will wrap text as required.
- * @return NULL if there is no resultant drawing area, otherwise a window handle.
- *
- * @param[in] gc The GConsoleObject structure to initialise. If this is NULL the structure is dynamically allocated.
- * @param[in] x,y The screen co-ordinates for the bottom left corner of the window
- * @param[in] width The width of the window
- * @param[in] height The height of the window
- * @param[in] font The font to use
- * @note The console is not automatically cleared on creation. You must do that by calling gwinClear() (possibly after changing your background color)
- * @note If the dispay does not support scrolling, the window will be cleared when the bottom line is reached.
- * @note The default drawing color gets set to White and the background drawing color to Black.
- * @note The dimensions and position may be changed to fit on the real screen.
- *
- * @api
- */
GHandle gwinCreateConsole(GConsoleObject *gc, coord_t x, coord_t y, coord_t width, coord_t height, font_t font) {
if (!(gc = (GConsoleObject *)_gwinInit((GWindowObject *)gc, x, y, width, height, sizeof(GConsoleObject))))
return 0;
@@ -99,29 +81,12 @@ GHandle gwinCreateConsole(GConsoleObject *gc, coord_t x, coord_t y, coord_t widt return (GHandle)gc;
}
-/**
- * @brief Get a stream from a console window suitable for use with chprintf().
- * @return The stream handle or NULL if this is not a console window.
- *
- * @param[in] gh The window handle (must be a console window)
- *
- * @api
- */
BaseSequentialStream *gwinGetConsoleStream(GHandle gh) {
if (gh->type != GW_CONSOLE)
return 0;
return (BaseSequentialStream *)&(((GConsoleObject *)(gh))->stream);
}
-/**
- * @brief Put a character at the cursor position in the window.
- * @note Uses the current foreground color to draw the character and fills the background using the background drawing color
- *
- * @param[in] gh The window handle (must be a console window)
- * @param[in] c The character to draw
- *
- * @api
- */
void gwinPutChar(GHandle gh, char c) {
uint8_t width;
#define gcw ((GConsoleObject *)gh)
@@ -178,30 +143,11 @@ void gwinPutChar(GHandle gh, char c) { #undef gcw
}
-/**
- * @brief Put a string at the cursor position in the window. It will wrap lines as required.
- * @note Uses the current foreground color to draw the string and fills the background using the background drawing color
- *
- * @param[in] gh The window handle (must be a console window)
- * @param[in] str The string to draw
- *
- * @api
- */
void gwinPutString(GHandle gh, const char *str) {
while(*str)
gwinPutChar(gh, *str++);
}
-/**
- * @brief Put the character array at the cursor position in the window. It will wrap lines as required.
- * @note Uses the current foreground color to draw the string and fills the background using the background drawing color
- *
- * @param[in] gh The window handle (must be a console window)
- * @param[in] str The string to draw
- * @param[in] n The number of characters to draw
- *
- * @api
- */
void gwinPutCharArray(GHandle gh, const char *str, size_t n) {
while(n--)
gwinPutChar(gh, *str++);
diff --git a/src/gwin/graph.c b/src/gwin/graph.c index 39628047..a9d20c4b 100644 --- a/src/gwin/graph.c +++ b/src/gwin/graph.c @@ -18,10 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
- * @file src/gwin/button.c
+ * @file src/gwin/graph.c
* @brief GWIN sub-system button code.
*
- * @defgroup Button Button
+ * @defgroup Graph Graph
* @ingroup GWIN
*
* @{
@@ -176,22 +176,6 @@ static void lineto(GGraphObject *gg, coord_t x0, coord_t y0, coord_t x1, coord_t }
}
-/**
- * @brief Create a graph window.
- * @return NULL if there is no resultant drawing area, otherwise a window handle.
- *
- * @param[in] gg The GGraphObject structure to initialise. If this is NULL the structure is dynamically allocated.
- * @param[in] x,y The screen co-ordinates for the bottom left corner of the window
- * @param[in] width The width of the window
- * @param[in] height The height of the window
- * @note The console is not automatically cleared on creation. You must do that by calling gwinClear() (possibly after changing your background color)
- * @note The coordinate system within the window for graphing operations (but not for any other drawing
- * operation) is relative to the bottom left corner and then shifted right and up by the specified
- * graphing x and y origin. Note that this system is inverted in the y direction relative to the display.
- * This gives the best graphing arrangement ie. increasing y values are closer to the top of the display.
- *
- * @api
- */
GHandle gwinCreateGraph(GGraphObject *gg, coord_t x, coord_t y, coord_t width, coord_t height) {
if (!(gg = (GGraphObject *)_gwinInit((GWindowObject *)gg, x, y, width, height, sizeof(GGraphObject))))
return 0;
@@ -202,15 +186,6 @@ GHandle gwinCreateGraph(GGraphObject *gg, coord_t x, coord_t y, coord_t width, c return (GHandle)gg;
}
-/**
- * @brief Set the style of the graphing operations.
- *
- * @param[in] gh The window handle (must be a graph window)
- * @param[in] pstyle The graph style to set.
- * @note The graph is not automatically redrawn. The new style will apply to any new drawing operations.
- *
- * @api
- */
void gwinGraphSetStyle(GHandle gh, const GGraphStyle *pstyle) {
#define gg ((GGraphObject *)gh)
@@ -242,15 +217,6 @@ void gwinGraphSetStyle(GHandle gh, const GGraphStyle *pstyle) { #undef gg
}
-/**
- * @brief Set the origin for graphing operations.
- *
- * @param[in] gh The window handle (must be a graph window)
- * @param[in] x, y The new origin for the graph (in graph coordinates relative to the bottom left corner).
- * @note The graph is not automatically redrawn. The new origin will apply to any new drawing operations.
- *
- * @api
- */
void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y) {
#define gg ((GGraphObject *)gh)
@@ -263,14 +229,6 @@ void gwinGraphSetOrigin(GHandle gh, coord_t x, coord_t y) { #undef gg
}
-/**
- * @brief Draw the axis and the background grid.
- *
- * @param[in] gh The window handle (must be a graph window)
- * @note The graph is not automatically cleared. You must do that first by calling gwinClear().
- *
- * @api
- */
void gwinGraphDrawAxis(GHandle gh) {
#define gg ((GGraphObject *)gh)
coord_t i, xmin, ymin, xmax, ymax;
@@ -332,14 +290,6 @@ void gwinGraphDrawAxis(GHandle gh) { #undef gg
}
-/**
- * @brief Start a new set of graphing data.
- * @details This prevents a line being drawn from the last data point to the next point to be drawn.
- *
- * @param[in] gh The window handle (must be a graph window)
- *
- * @api
- */
void gwinGraphStartSet(GHandle gh) {
if (gh->type != GW_GRAPH)
return;
@@ -347,15 +297,6 @@ void gwinGraphStartSet(GHandle gh) { gh->flags &= ~GGRAPH_FLG_CONNECTPOINTS;
}
-/**
- * @brief Draw a graph point.
- * @details A graph point and a line connecting to the previous point will be drawn.
- *
- * @param[in] gh The window handle (must be a graph window)
- * @param[in] x, y The new point for the graph.
- *
- * @api
- */
void gwinGraphDrawPoint(GHandle gh, coord_t x, coord_t y) {
#define gg ((GGraphObject *)gh)
@@ -382,17 +323,6 @@ void gwinGraphDrawPoint(GHandle gh, coord_t x, coord_t y) { #undef gg
}
-/**
- * @brief Draw multiple graph points.
- * @details A graph point and a line connecting to each previous point will be drawn.
- *
- * @param[in] gh The window handle (must be a graph window)
- * @param[in] points The array of points for the graph.
- * @param[in] count The number of points in the array.
- * @note This is slightly more efficient than calling gwinGraphDrawPoint() repeatedly.
- *
- * @api
- */
void gwinGraphDrawPoints(GHandle gh, const GGraphPoint *points, unsigned count) {
#define gg ((GGraphObject *)gh)
unsigned i;
|