2013-03-18 08:29:28 +00:00
|
|
|
/*
|
2013-06-15 11:09:02 +00:00
|
|
|
* This file is subject to the terms of the GFX License. If a copy of
|
2013-05-03 14:36:17 +00:00
|
|
|
* the license was not distributed with this file, you can obtain one at:
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-07-21 20:20:37 +00:00
|
|
|
* http://ugfx.org/license.html
|
2013-03-18 08:29:28 +00:00
|
|
|
*/
|
|
|
|
|
2013-05-06 04:44:47 +00:00
|
|
|
/**
|
|
|
|
* @file include/gwin/gwin.h
|
|
|
|
*
|
|
|
|
* @defgroup Window Window
|
|
|
|
* @ingroup GWIN
|
|
|
|
*
|
2013-06-06 04:33:32 +00:00
|
|
|
* @details GWIN provides a basic window manager which allows it to easily
|
|
|
|
* create and destroy different windows at runtime. Each window
|
|
|
|
* will have it's own properties such as colors as well as
|
|
|
|
* it's own drawing origin.
|
2013-05-06 04:44:47 +00:00
|
|
|
*
|
|
|
|
* @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2013-03-18 08:29:28 +00:00
|
|
|
#ifndef _GWIN_H
|
|
|
|
#define _GWIN_H
|
|
|
|
|
|
|
|
#include "gfx.h"
|
|
|
|
|
|
|
|
#if GFX_USE_GWIN || defined(__DOXYGEN__)
|
|
|
|
|
2014-01-04 03:41:32 +00:00
|
|
|
/* Forward declaration */
|
|
|
|
typedef struct GWindowObject *GHandle;
|
|
|
|
|
2013-06-06 04:33:32 +00:00
|
|
|
/**
|
|
|
|
* @brief A window object structure
|
2013-06-07 16:27:59 +00:00
|
|
|
* @note Do not access the members directly. Treat it as a black-box and use the method functions.
|
2013-06-06 04:33:32 +00:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
typedef struct GWindowObject {
|
2013-06-07 16:27:59 +00:00
|
|
|
#if GWIN_NEED_WINDOWMANAGER
|
2013-06-10 07:18:01 +00:00
|
|
|
// This MUST be the first member of the struct
|
2013-06-07 16:27:59 +00:00
|
|
|
gfxQueueASyncItem wmq; // @< The next window (for the window manager)
|
|
|
|
#endif
|
|
|
|
const struct gwinVMT *vmt; // @< The VMT for this GWIN
|
2013-10-24 08:36:11 +00:00
|
|
|
GDisplay * display; // @< The display this window is on.
|
2014-01-05 04:05:59 +00:00
|
|
|
coord_t x, y; // @< Position relative to parent
|
2013-06-07 16:27:59 +00:00
|
|
|
coord_t width, height; // @< Dimensions of this window
|
|
|
|
color_t color, bgcolor; // @< The current drawing colors
|
|
|
|
uint16_t flags; // @< Window flags (the meaning is private to the GWIN class)
|
|
|
|
#if GDISP_NEED_TEXT
|
|
|
|
font_t font; // @< The current font
|
|
|
|
#endif
|
2014-01-04 03:41:32 +00:00
|
|
|
#if GWIN_NEED_HIERARCHY
|
2014-01-04 14:51:18 +00:00
|
|
|
GHandle parent; // @< The parent widget
|
|
|
|
GHandle sibling; // @< The widget to its left (add right later as well)
|
|
|
|
GHandle child; // @< The child widget
|
2014-01-04 03:41:32 +00:00
|
|
|
#endif
|
2013-03-18 08:29:28 +00:00
|
|
|
} GWindowObject, * GHandle;
|
2013-06-06 04:33:32 +00:00
|
|
|
/* @} */
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-24 12:58:37 +00:00
|
|
|
/**
|
|
|
|
* @brief The structure to initialise a GWIN.
|
|
|
|
*
|
|
|
|
* @note Some gwin's will need extra parameters.
|
|
|
|
* @note The dimensions and position may be changed to fit on the real screen.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
typedef struct GWindowInit {
|
|
|
|
coord_t x, y; // @< The initial screen position
|
|
|
|
coord_t width, height; // @< The initial dimension
|
|
|
|
bool_t show; // @< Should the window be visible initially
|
|
|
|
} GWindowInit;
|
|
|
|
/* @} */
|
|
|
|
|
2013-03-18 08:29:28 +00:00
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief A window's minimized, maximized or normal size
|
2013-05-20 14:18:10 +00:00
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
typedef enum { GWIN_NORMAL, GWIN_MAXIMIZE, GWIN_MINIMIZE } GWindowMinMax;
|
2013-05-20 14:18:10 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2013-06-06 06:48:30 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/*-------------------------------------------------
|
|
|
|
* Window Manager functions
|
|
|
|
*-------------------------------------------------*/
|
2013-06-06 06:48:30 +00:00
|
|
|
|
2013-12-28 15:33:49 +00:00
|
|
|
#if GWIN_NEED_WINDOWMANAGER || defined(__DOXYGEN__)
|
2013-06-07 16:27:59 +00:00
|
|
|
// Forward definition
|
|
|
|
struct GWindowManager;
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Set the window manager for the GWIN system.
|
|
|
|
*
|
|
|
|
* @param[in] gwm The window manager to use. Can be NULL to turn off the existing window manager.
|
|
|
|
*
|
|
|
|
* @note A window manager is responsible for handling when window visibility is changed or
|
|
|
|
* a window is resized for moved. Note that only saved window states will be redrawn. Each
|
|
|
|
* window type can save different information (or none at all). See the documentation on each window
|
|
|
|
* type to see which information it saves (and can therefore be automatically redrawn).
|
|
|
|
* For window types that do not save any state information, the window manager determines what to do.
|
|
|
|
* Generally it will just clear the window to its background color.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinSetWindowManager(struct GWindowManager *gwm);
|
|
|
|
#endif
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/*-------------------------------------------------
|
|
|
|
* Functions that affect all windows
|
|
|
|
*-------------------------------------------------*/
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-06 04:33:32 +00:00
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Set the default foreground color for all new GWIN windows
|
2013-06-06 04:33:32 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] clr The color to be set
|
|
|
|
*
|
|
|
|
* @api
|
2013-06-06 04:33:32 +00:00
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinSetDefaultColor(color_t clr);
|
2013-06-06 04:33:32 +00:00
|
|
|
|
2013-07-03 14:20:32 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the default foreground color for all new GWIN windows
|
|
|
|
*
|
2013-07-17 02:44:29 +00:00
|
|
|
* @return The current default color for all new GWIN windows
|
|
|
|
*
|
2013-07-03 14:20:32 +00:00
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
color_t gwinGetDefaultColor(void);
|
|
|
|
|
2013-03-18 08:29:28 +00:00
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Set the default background color for all new GWIN windows
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] bgclr The background color
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinSetDefaultBgColor(color_t bgclr);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-07-03 14:20:32 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the default background color for all new GWIN windows
|
|
|
|
*
|
2013-07-17 02:44:29 +00:00
|
|
|
* @return The current default background color for all new GWIN windows
|
|
|
|
*
|
2013-07-03 14:20:32 +00:00
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
color_t gwinGetDefaultBgColor(void);
|
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Set the default font for all new GWIN windows
|
|
|
|
*
|
2013-07-01 15:49:57 +00:00
|
|
|
* @param[in] font The new font to be set
|
2013-06-07 16:27:59 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinSetDefaultFont(font_t font);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-07-02 17:26:48 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the current default font
|
|
|
|
*
|
|
|
|
* @return The current default font
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
font_t gwinGetDefaultFont(void);
|
|
|
|
#endif
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/*-------------------------------------------------
|
|
|
|
* Base functions
|
|
|
|
*-------------------------------------------------*/
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Create a basic window.
|
|
|
|
* @return NULL if there is no resultant drawing area, otherwise a window handle.
|
|
|
|
*
|
2013-10-24 08:36:11 +00:00
|
|
|
* @param[in] g The GDisplay to display this window on
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] pgw The window structure to initialize. If this is NULL the structure is dynamically allocated.
|
2013-06-24 12:58:37 +00:00
|
|
|
* @param[in] pInit How to initialise the window
|
2013-06-07 16:27:59 +00:00
|
|
|
*
|
|
|
|
* @note The drawing color and the background color get set to the current defaults. If you haven't called
|
|
|
|
* @p gwinSetDefaultColor() or @p gwinSetDefaultBgColor() then these are White and Black respectively.
|
|
|
|
* @note The font gets set to the current default font. If you haven't called @p gwinSetDefaultFont() then there
|
|
|
|
* is no default font and text drawing operations will no nothing.
|
|
|
|
* @note A basic window does not save the drawing state. It is not automatically redrawn if the window is moved or
|
|
|
|
* its visibility state is changed.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-10-24 08:36:11 +00:00
|
|
|
GHandle gwinGWindowCreate(GDisplay *g, GWindowObject *pgw, const GWindowInit *pInit);
|
|
|
|
#define gwinWindowCreate(pgw, pInit) gwinGWindowCreate(GDISP, pgw, pInit);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Destroy a window (of any type). Releases any dynamically allocated memory.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDestroy(GHandle gh);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the real class name of the GHandle
|
|
|
|
* @details Returns a string describing the object class.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
2013-07-17 02:44:29 +00:00
|
|
|
* @return A string describing the object class.
|
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @api
|
|
|
|
*/
|
2013-07-17 02:44:29 +00:00
|
|
|
const char* gwinGetClassName(GHandle gh);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Get an ID that uniquely describes the class of the GHandle
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
#define gwinGetClassID(gh) ((void *)((gh)->vmt))
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Get the X coordinate of the window
|
|
|
|
* @details Returns the X coordinate of the origin of the window.
|
|
|
|
* The coordinate is relative to the physical screen zero point.
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
#define gwinGetScreenX(gh) ((gh)->x)
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the Y coordinate of the window
|
|
|
|
* @details Returns the Y coordinate of the origin of the window.
|
|
|
|
* The coordinate is relative to the physical screen zero point.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
#define gwinGetScreenY(gh) ((gh)->y)
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Get the width of the window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
#define gwinGetWidth(gh) ((gh)->width)
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Get the height of the window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
#define gwinGetHeight(gh) ((gh)->height)
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Set foreground color
|
|
|
|
* @details Set the color which will be used to draw
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
* @param[in] clr The color to be set
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
#define gwinSetColor(gh, clr) (gh)->color = (clr)
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Set background color
|
|
|
|
* @details Set the color which will be used as background
|
|
|
|
* @note gwinClear() must be called to set the background color
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
|
|
|
* @param[in] bgclr The background color
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
#define gwinSetBgColor(gh, bgclr) (gh)->bgcolor = (bgclr)
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2014-01-06 21:06:36 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the foreground color of a window
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
#define gwinGetColor(gh) (gh)->color
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the background color of a window
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
#define gwinGetBgColor(gh) (gh)->bgcolor
|
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Sets whether a window is visible or not
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
|
|
|
* @param[in] visible Whether the window should be visible or not
|
|
|
|
*
|
|
|
|
* @note When a window is marked as not visible, drawing operations
|
|
|
|
* on the window do nothing.
|
|
|
|
* @note When a window is marked as visible, it is not automatically
|
|
|
|
* redrawn as many window types don't remember their drawing state.
|
|
|
|
* Widgets such as Buttons, Sliders etc will be redrawn.
|
|
|
|
* @note If there is no window manager in use, when a window is marked
|
|
|
|
* as not visible, nothing is done to remove the window from the screen.
|
|
|
|
* When there is a window manager, it is up to the window manager to
|
|
|
|
* handle what happens.
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinSetVisible(GHandle gh, bool_t visible);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Gets the visibility of a window
|
|
|
|
* @return TRUE if visible
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
bool_t gwinGetVisible(GHandle gh);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-07-03 14:59:12 +00:00
|
|
|
/**
|
|
|
|
* @brief Enable or disable a window
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] enabled Enable or disable the window
|
|
|
|
*
|
|
|
|
* @note The window is automatically redrawn if it
|
|
|
|
* supports self-redrawing.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinSetEnabled(GHandle gh, bool_t enabled);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Gets the enabled state of a window
|
|
|
|
* @return TRUE if enabled
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
bool_t gwinGetEnabled(GHandle gh);
|
|
|
|
|
2013-03-18 08:29:28 +00:00
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Move a window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
|
|
|
* @param[in] x, y The new position (screen relative) for this window
|
|
|
|
*
|
|
|
|
* @note The final window position may not be the requested position. Windows
|
|
|
|
* are clipped to the screen area and the window manager may also affect the position.
|
|
|
|
* @note The window is redrawn if it is visible. See the comments in @p gwinSetVisible()
|
|
|
|
* with regard to what can be redrawn and what can't.
|
|
|
|
* @note It is up to the window manager to determine what happens with the screen area
|
|
|
|
* uncovered by moving the window. When there is no window manager, nothing
|
|
|
|
* is done with the uncovered area.
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinMove(GHandle gh, coord_t x, coord_t y);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/**
|
|
|
|
* @brief Resize a window
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
* @param[in] width, height The new size of the window
|
|
|
|
*
|
|
|
|
* @note The final window size may not be the requested size. Windows
|
|
|
|
* are clipped to the screen area and the window manager may also affect the size.
|
|
|
|
* @note The window is redrawn if it is visible. See the comments in @p gwinSetVisible()
|
|
|
|
* with regard to what can be redrawn and what can't.
|
|
|
|
* @note It is up to the window manager to determine what happens with any screen area
|
|
|
|
* uncovered by resizing the window. When there is no window manager, nothing
|
|
|
|
* is done with the uncovered area.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinResize(GHandle gh, coord_t width, coord_t height);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-07-07 09:40:37 +00:00
|
|
|
* @brief Redraw a window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
2013-07-07 09:40:37 +00:00
|
|
|
* @note This is normally never required as windows and widgets will redraw as required.
|
|
|
|
* Note that some windows are incapable of redrawing themselves as they don't save
|
|
|
|
* their drawing state.
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-07-07 09:40:37 +00:00
|
|
|
void gwinRedraw(GHandle gh);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2014-01-04 03:41:32 +00:00
|
|
|
#if GWIN_NEED_HIERARCHY
|
|
|
|
/**
|
|
|
|
* @brief Add a child widget to a parent one
|
|
|
|
*
|
2014-01-05 19:42:19 +00:00
|
|
|
* @param[in] parent The parent window (does not need to be parent yet)
|
|
|
|
* @param[in] child The child window
|
|
|
|
* @param[in] last Should the child window be added to the front or the back of the list?
|
2014-01-04 03:41:32 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinAddChild(GHandle parent, GHandle child, bool_t last);
|
2014-01-04 20:10:10 +00:00
|
|
|
|
2014-01-05 19:42:19 +00:00
|
|
|
/**
|
|
|
|
* @brief Remove a child from a parent
|
|
|
|
*
|
|
|
|
* @note Other children of the same parent stay
|
|
|
|
* @note Children of the child are lost, they have to be reassigned manually if necessary.
|
|
|
|
*
|
|
|
|
* @param[in] child The child window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinRemoveChild(GHandle child);
|
|
|
|
|
2014-01-06 20:43:25 +00:00
|
|
|
/**
|
|
|
|
* @brief Redraw only the children of a parent but not the parent itself
|
|
|
|
*
|
|
|
|
* @details This routine does exactly the same as @p gwinRedraw() but does not
|
|
|
|
* issue a redraw of the passed widget but only of it's children.
|
|
|
|
*
|
|
|
|
* @param[in] gh The widget
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinRedrawChildren(GHandle gh);
|
|
|
|
|
2014-01-04 20:10:10 +00:00
|
|
|
/**
|
|
|
|
* @brief Get first child of a widget
|
|
|
|
*
|
|
|
|
* @return The first child or NULL if the widget has no children
|
|
|
|
*
|
|
|
|
* @param[in] gh The parent widget
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
GHandle gwinGetFirstChild(GHandle gh);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get the next child of a widget
|
|
|
|
*
|
|
|
|
* @return The next child or NULL if no more childs
|
|
|
|
*
|
|
|
|
* @param[in] gh The parent widget
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
GHandle gwinGetNextChild(GHandle gh);
|
2014-01-04 03:41:32 +00:00
|
|
|
#endif
|
|
|
|
|
2013-12-28 15:33:49 +00:00
|
|
|
#if GWIN_NEED_WINDOWMANAGER || defined (__DOXYGEN__)
|
2013-11-15 16:01:16 +00:00
|
|
|
/**
|
|
|
|
* @brief Redraw a window
|
|
|
|
*
|
|
|
|
* @param[in] g The display to redraw. Passing NULL will redraw all displays.
|
|
|
|
* @param[in] preserve Should the redraw try to preserve existing screen data for those
|
|
|
|
* windows that can't redraw themselves?
|
|
|
|
*
|
|
|
|
* @note This is normally never required as windows and widgets will redraw as required.
|
|
|
|
* @note Some windows are incapable of redrawing themselves as they don't save
|
|
|
|
* their drawing state.
|
|
|
|
* @note This does not clear the background - just redraws the gwin windows (where possible)
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinRedrawDisplay(GDisplay *g, bool_t preserve);
|
|
|
|
|
2013-07-07 09:40:37 +00:00
|
|
|
/**
|
|
|
|
* @brief Minimize, Maximize or Restore a window
|
|
|
|
* @pre GWIN_NEED_WINDOWMANAGER must be TRUE
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
* @param[in] minmax The new minimized/maximized state
|
|
|
|
*
|
|
|
|
* @note The final window state may not be the requested state. Window Managers
|
|
|
|
* do not need to implement changing the minmax state. If there is no
|
|
|
|
* window manager this call is ignored.
|
|
|
|
* @note The window is redrawn if it is changed. See the comments in @p gwinSetVisible()
|
|
|
|
* with regard to what can be redrawn and what can't.
|
|
|
|
* @note It is up to the window manager to determine what happens with any screen area
|
|
|
|
* uncovered by resizing the window.
|
|
|
|
* @note When a window is minimised it may be asked to draw the window or the window
|
|
|
|
* manager may draw the minimised window.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinSetMinMax(GHandle gh, GWindowMinMax minmax);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-07-07 09:40:37 +00:00
|
|
|
/**
|
|
|
|
* @brief Get the Minimized/Maximized state of a window
|
|
|
|
* @pre GWIN_NEED_WINDOWMANAGER must be TRUE
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
GWindowMinMax gwinGetMinMax(GHandle gh);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Raise a window to the top of the z-order
|
|
|
|
* @pre GWIN_NEED_WINDOWMANAGER must be TRUE
|
|
|
|
*
|
|
|
|
* @param[in] gh The window
|
|
|
|
*
|
|
|
|
* @note The window z-order is only supported by some window managers. See the comments
|
|
|
|
* in @p gwinSetVisible() with regard to what can be redrawn and what can't.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinRaise(GHandle gh);
|
|
|
|
#endif
|
2013-06-07 16:27:59 +00:00
|
|
|
|
|
|
|
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Set the current font for this window.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] font The font to use for text functions
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinSetFont(GHandle gh, font_t font);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*-------------------------------------------------
|
|
|
|
* Drawing functions
|
|
|
|
*-------------------------------------------------*/
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Clear the window
|
|
|
|
* @note Uses the current background color to clear the window
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinClear(GHandle gh);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Set a pixel in the window
|
|
|
|
* @note Uses the current foreground color to set the pixel
|
2013-03-18 08:29:28 +00:00
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] x,y The coordinates of the pixel
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinDrawPixel(GHandle gh, coord_t x, coord_t y);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Draw a line in the window
|
|
|
|
* @note Uses the current foreground color to draw the line
|
2013-03-18 08:29:28 +00:00
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] x0,y0 The start position
|
|
|
|
* @param[in] x1,y1 The end position
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinDrawLine(GHandle gh, coord_t x0, coord_t y0, coord_t x1, coord_t y1);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Draw a box in the window
|
|
|
|
* @note Uses the current foreground color to draw the box
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] x,y The start position
|
|
|
|
* @param[in] cx,cy The size of the box (outside dimensions)
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinDrawBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Fill an rectangular area in the window
|
|
|
|
* @note Uses the current foreground color to fill the box
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] x,y The start position
|
|
|
|
* @param[in] cx,cy The size of the box (outside dimensions)
|
2013-03-18 08:29:28 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinFillArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy);
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-04-06 11:54:19 +00:00
|
|
|
/**
|
2013-06-07 16:27:59 +00:00
|
|
|
* @brief Fill an area in the window using the supplied bitmap.
|
|
|
|
* @details The bitmap is in the pixel format specified by the low level driver
|
|
|
|
* @note If GDISP_NEED_ASYNC is defined then the buffer must be static
|
|
|
|
* or at least retained until this call has finished the blit. You can
|
|
|
|
* tell when all graphics drawing is finished by @p gdispIsBusy() going FALSE.
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
2013-04-06 11:54:19 +00:00
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
2013-06-07 16:27:59 +00:00
|
|
|
* @param[in] x, y The start filled area
|
|
|
|
* @param[in] cx, cy The width and height to be filled
|
|
|
|
* @param[in] srcx, srcy The bitmap position to start the fill from
|
|
|
|
* @param[in] srccx The width of a line in the bitmap.
|
|
|
|
* @param[in] buffer The pixels to use to fill the area.
|
|
|
|
*
|
|
|
|
* @api
|
2013-04-06 11:54:19 +00:00
|
|
|
*/
|
2013-06-07 16:27:59 +00:00
|
|
|
void gwinBlitArea(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer);
|
|
|
|
|
|
|
|
/*-------------------------------------------------
|
|
|
|
* Circle, ellipse and arc functions
|
|
|
|
*-------------------------------------------------*/
|
|
|
|
|
|
|
|
#if GDISP_NEED_CIRCLE || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Draw a circle in the window.
|
|
|
|
* @note Uses the current foreground color to draw the circle
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x, y The center of the circle
|
|
|
|
* @param[in] radius The radius of the circle
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawCircle(GHandle gh, coord_t x, coord_t y, coord_t radius);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a filled circle in the window.
|
|
|
|
* @note Uses the current foreground color to draw the filled circle
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x, y The center of the circle
|
|
|
|
* @param[in] radius The radius of the circle
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillCircle(GHandle gh, coord_t x, coord_t y, coord_t radius);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if GDISP_NEED_ELLIPSE || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Draw an ellipse.
|
|
|
|
* @note Uses the current foreground color to draw the ellipse
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The center of the ellipse
|
|
|
|
* @param[in] a,b The dimensions of the ellipse
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw an filled ellipse.
|
|
|
|
* @note Uses the current foreground color to draw the filled ellipse
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The center of the ellipse
|
|
|
|
* @param[in] a,b The dimensions of the ellipse
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillEllipse(GHandle gh, coord_t x, coord_t y, coord_t a, coord_t b);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if GDISP_NEED_ARC || defined(__DOXYGEN__)
|
|
|
|
/*
|
|
|
|
* @brief Draw an arc in the window.
|
|
|
|
* @note Uses the current foreground color to draw the arc
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The center point
|
|
|
|
* @param[in] radius The radius of the arc
|
|
|
|
* @param[in] start The start angle (0 to 360)
|
|
|
|
* @param[in] end The end angle (0 to 360)
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @brief Draw a filled arc in the window.
|
|
|
|
* @note Uses the current foreground color to draw the filled arc
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The center point
|
|
|
|
* @param[in] radius The radius of the arc
|
|
|
|
* @param[in] start The start angle (0 to 360)
|
|
|
|
* @param[in] end The end angle (0 to 360)
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillArc(GHandle gh, coord_t x, coord_t y, coord_t radius, coord_t startangle, coord_t endangle);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*-------------------------------------------------
|
|
|
|
* Pixel read-back functions
|
|
|
|
*-------------------------------------------------*/
|
|
|
|
|
|
|
|
#if GDISP_NEED_PIXELREAD || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Get the color of a pixel in the window.
|
|
|
|
* @return The color of the pixel.
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position in the window
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
color_t gwinGetPixelColor(GHandle gh, coord_t x, coord_t y);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*-------------------------------------------------
|
|
|
|
* Text functions
|
|
|
|
*-------------------------------------------------*/
|
|
|
|
|
|
|
|
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Draw a text character at the specified position in the window.
|
|
|
|
* @pre The font must have been set.
|
|
|
|
* @note Uses the current foreground color to draw the character
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position for the text
|
|
|
|
* @param[in] c The character to draw
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawChar(GHandle gh, coord_t x, coord_t y, char c);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a text character with a filled background at the specified position in the window.
|
|
|
|
* @pre The font must have been set.
|
|
|
|
* @note Uses the current foreground color to draw the character and fills the background using the background drawing color
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position for the text
|
|
|
|
* @param[in] c The character to draw
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillChar(GHandle gh, coord_t x, coord_t y, char c);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a text string in the window
|
|
|
|
* @pre The font must have been set.
|
|
|
|
* @note Uses the current foreground color to draw the character
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position for the text
|
|
|
|
* @param[in] str The string to draw
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawString(GHandle gh, coord_t x, coord_t y, const char *str);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a text string with a filled background in the window
|
|
|
|
* @pre The font must have been set.
|
|
|
|
* @note Uses the current foreground color to draw the character and fills the background using the background drawing color
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position for the text
|
|
|
|
* @param[in] str The string to draw
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillString(GHandle gh, coord_t x, coord_t y, const char *str);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a text string verticly centered within the specified box.
|
|
|
|
* @pre The font must have been set.
|
|
|
|
* @note Uses the current foreground color to draw the character.
|
|
|
|
* @note The specified box does not need to align with the window box
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position for the text (need to define top-right or base-line - check code)
|
|
|
|
* @param[in] cx,cy The width and height of the box
|
|
|
|
* @param[in] str The string to draw
|
|
|
|
* @param[in] justify Justify the text left, center or right within the box
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Draw a text string verticly centered within the specified filled box.
|
|
|
|
* @pre The font must have been set.
|
|
|
|
* @note Uses the current foreground color to draw the character and fills the background using the background drawing color
|
|
|
|
* @note The entire box is filled. Note this box does not need to align with the window box
|
|
|
|
* @note May leave GDISP clipping to this window's dimensions
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] x,y The position for the text (need to define top-right or base-line - check code)
|
|
|
|
* @param[in] cx,cy The width and height of the box
|
|
|
|
* @param[in] str The string to draw
|
|
|
|
* @param[in] justify Justify the text left, center or right within the box
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillStringBox(GHandle gh, coord_t x, coord_t y, coord_t cx, coord_t cy, const char* str, justify_t justify);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*-------------------------------------------------
|
|
|
|
* Polygon functions
|
|
|
|
*-------------------------------------------------*/
|
|
|
|
|
|
|
|
#if GDISP_NEED_CONVEX_POLYGON || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Draw an enclosed polygon (convex, non-convex or complex).
|
|
|
|
*
|
|
|
|
* @note Uses the current foreground color.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] tx, ty Transform all points in pntarray by tx, ty
|
|
|
|
* @param[in] pntarray An array of points
|
|
|
|
* @param[in] cnt The number of points in the array
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinDrawPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Fill a convex polygon
|
|
|
|
* @details Doesn't handle non-convex or complex polygons.
|
|
|
|
*
|
|
|
|
* @note Uses the current foreground color.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] tx, ty Transform all points in pntarray by tx, ty
|
|
|
|
* @param[in] pntarray An array of points
|
|
|
|
* @param[in] cnt The number of points in the array
|
|
|
|
*
|
|
|
|
* @note Convex polygons are those that have no internal angles. That is;
|
|
|
|
* you can draw a line from any point on the polygon to any other point
|
|
|
|
* on the polygon without it going outside the polygon. In our case we generalise
|
|
|
|
* this a little by saying that an infinite horizontal line (at any y value) will cross
|
|
|
|
* no more than two edges on the polygon. Some non-convex polygons do fit this criteria
|
|
|
|
* and can therefore be drawn.
|
|
|
|
* @note This routine is designed to be very efficient with even simple display hardware.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gwinFillConvexPoly(GHandle gh, coord_t tx, coord_t ty, const point *pntarray, unsigned cnt);
|
|
|
|
#endif
|
|
|
|
|
2013-07-22 07:05:42 +00:00
|
|
|
/*-------------------------------------------------
|
|
|
|
* Image functions
|
|
|
|
*-------------------------------------------------*/
|
|
|
|
|
|
|
|
#if GDISP_NEED_IMAGE || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief Draw the image
|
|
|
|
* @return GDISP_IMAGE_ERR_OK (0) on success or an error code.
|
|
|
|
*
|
|
|
|
* @param[in] gh The window handle
|
|
|
|
* @param[in] img The image structure
|
|
|
|
* @param[in] x,y The window location to draw the image
|
|
|
|
* @param[in] cx,cy The area on the screen to draw
|
|
|
|
* @param[in] sx,sy The image position to start drawing at
|
|
|
|
*
|
|
|
|
* @pre gdispImageOpen() must have returned successfully.
|
|
|
|
*
|
|
|
|
* @note If sx,sy + cx,cy is outside the image boundaries the area outside the image
|
|
|
|
* is simply not drawn.
|
|
|
|
* @note If @p gdispImageCache() has been called first for this frame, this routine will draw using a
|
|
|
|
* fast blit from the cached frame. If not, it reads the input and decodes it as it
|
|
|
|
* is drawing. This may be significantly slower than if the image has been cached (but
|
|
|
|
* uses a lot less RAM)
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
gdispImageError gwinDrawImage(GHandle gh, gdispImage *img, coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t sx, coord_t sy);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
/*-------------------------------------------------
|
|
|
|
* Additional functionality
|
|
|
|
*-------------------------------------------------*/
|
|
|
|
|
|
|
|
/* Include widgets */
|
|
|
|
#if GWIN_NEED_WIDGET || defined(__DOXYGEN__)
|
|
|
|
#include "gwin/gwidget.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Include extra window types */
|
|
|
|
#if GWIN_NEED_CONSOLE || defined(__DOXYGEN__)
|
|
|
|
#include "gwin/console.h"
|
|
|
|
#endif
|
2013-07-01 08:10:45 +00:00
|
|
|
|
2013-06-07 16:27:59 +00:00
|
|
|
#if GWIN_NEED_GRAPH || defined(__DOXYGEN__)
|
|
|
|
#include "gwin/graph.h"
|
|
|
|
#endif
|
2013-03-18 08:29:28 +00:00
|
|
|
|
2013-07-01 08:10:45 +00:00
|
|
|
#if GWIN_NEED_IMAGE || defined(__DOXYGEN__)
|
|
|
|
#include "gwin/image.h"
|
|
|
|
#endif
|
|
|
|
|
2013-03-18 08:29:28 +00:00
|
|
|
#endif /* GFX_USE_GWIN */
|
|
|
|
|
|
|
|
#endif /* _GWIN_H */
|
|
|
|
/** @} */
|