rename a lot of functions in lv_misc

This commit is contained in:
Gabor Kiss-Vamosi
2017-11-23 21:28:36 +01:00
parent c3471fd04e
commit 1fcda8092e
175 changed files with 2257 additions and 2289 deletions

View File

@@ -1,10 +1,10 @@
/**
* @file area.h
* @file lv_area.h
*
*/
#ifndef AREA_H
#define AREA_H
#ifndef LV_AREA_H
#define LV_AREA_H
#ifdef __cplusplus
extern "C" {
@@ -24,27 +24,27 @@ extern "C" {
/*********************
* DEFINES
*********************/
#define CORD_MAX (16383) /*To avoid overflow don't let the max [-32,32k] range */
#define CORD_MIN (-16384)
#define LV_COORD_MAX (16383) /*To avoid overflow don't let the max [-32,32k] range */
#define LV_COORD_MIN (-16384)
/**********************
* TYPEDEFS
**********************/
typedef int16_t cord_t;
typedef int16_t lv_coord_t;
typedef struct
{
cord_t x;
cord_t y;
}point_t;
lv_coord_t x;
lv_coord_t y;
}lv_point_t;
typedef struct
{
cord_t x1;
cord_t y1;
cord_t x2;
cord_t y2;
}area_t;
lv_coord_t x1;
lv_coord_t y1;
lv_coord_t x2;
lv_coord_t y2;
}lv_area_t;
/**********************
* GLOBAL PROTOTYPES
@@ -58,16 +58,16 @@ typedef struct
* @param x2 right coordinate of the area
* @param y2 bottom coordinate of the area
*/
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2);
void lv_area_set(lv_area_t * area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2);
/**
* Copy an area
* @param dest pointer to the destination area
* @param src pointer to the source area
*/
static void inline area_cpy(area_t * dest, const area_t * src)
static void inline area_cpy(lv_area_t * dest, const lv_area_t * src)
{
memcpy(dest, src, sizeof(area_t));
memcpy(dest, src, sizeof(lv_area_t));
}
/**
@@ -75,7 +75,7 @@ static void inline area_cpy(area_t * dest, const area_t * src)
* @param area_p pointer to an area
* @return the width of the area (if x1 == x2 -> width = 1)
*/
static inline cord_t area_get_width(const area_t * area_p)
static inline lv_coord_t area_get_width(const lv_area_t * area_p)
{
return area_p->x2 - area_p->x1 + 1;
}
@@ -85,7 +85,7 @@ static inline cord_t area_get_width(const area_t * area_p)
* @param area_p pointer to an area
* @return the height of the area (if y1 == y2 -> height = 1)
*/
static inline cord_t area_get_height(const area_t * area_p)
static inline lv_coord_t area_get_height(const lv_area_t * area_p)
{
return area_p->y2 - area_p->y1 + 1;
}
@@ -95,14 +95,14 @@ static inline cord_t area_get_height(const area_t * area_p)
* @param area_p pointer to an area
* @param w the new width of the area (w == 1 makes x1 == x2)
*/
void area_set_width(area_t * area_p, cord_t w);
void lv_area_set_width(lv_area_t * area_p, lv_coord_t w);
/**
* Set the height of an area
* @param area_p pointer to an area
* @param h the new height of the area (h == 1 makes y1 == y2)
*/
void area_set_height(area_t * area_p, cord_t h);
void lv_area_set_height(lv_area_t * area_p, lv_coord_t h);
/**
* Set the position of an area (width and height will be kept)
@@ -110,14 +110,14 @@ void area_set_height(area_t * area_p, cord_t h);
* @param x the new x coordinate of the area
* @param y the new y coordinate of the area
*/
void area_set_pos(area_t * area_p, cord_t x, cord_t y);
void lv_area_set_pos(lv_area_t * area_p, lv_coord_t x, lv_coord_t y);
/**
* Return with area of an area (x * y)
* @param area_p pointer to an area
* @return size of area
*/
uint32_t area_get_size(const area_t * area_p);
uint32_t lv_area_get_size(const lv_area_t * area_p);
/**
* Get the common parts of two areas
@@ -126,7 +126,7 @@ uint32_t area_get_size(const area_t * area_p);
* @param a2_p pointer to the second area
* @return false: the two area has NO common parts, res_p is invalid
*/
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p);
bool lv_area_union(lv_area_t * res_p, const lv_area_t * a1_p, const lv_area_t * a2_p);
/**
* Join two areas into a third which involves the other two
@@ -134,7 +134,7 @@ bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p);
* @param a1_p pointer to the first area
* @param a2_p pointer to the second area
*/
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p);
void lv_area_join(lv_area_t * a_res_p, const lv_area_t * a1_p, const lv_area_t * a2_p);
/**
* Check if a point is on an area
@@ -142,7 +142,7 @@ void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p);
* @param p_p pointer to a point
* @return false:the point is out of the area
*/
bool area_is_point_on(const area_t * a_p, const point_t * p_p);
bool lv_area_is_point_on(const lv_area_t * a_p, const lv_point_t * p_p);
/**
* Check if two area has common parts
@@ -150,7 +150,7 @@ bool area_is_point_on(const area_t * a_p, const point_t * p_p);
* @param a2_p pointer to an other area
* @return false: a1_p and a2_p has no common parts
*/
bool area_is_on(const area_t * a1_p, const area_t * a2_p);
bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p);
/**
* Check if an area is fully on an other
@@ -158,7 +158,7 @@ bool area_is_on(const area_t * a1_p, const area_t * a2_p);
* @param aholder pointer to an area which could involve ain_p
* @return
*/
bool area_is_in(const area_t * ain_p, const area_t * aholder_p);
bool lv_area_is_in(const lv_area_t * ain_p, const lv_area_t * aholder_p);
/**********************
* MACROS