Tizen Native API

Functions

static int eina_spans_intersect (int c1, int l1, int c2, int l2)
 Check if the given spans intersect.
static Eina_Bool eina_rectangle_is_empty (const Eina_Rectangle *r)
 Check if the given rectangle is empty.
static void eina_rectangle_coords_from (Eina_Rectangle *r, int x, int y, int w, int h)
 Set the coordinates and size of the given rectangle.
static Eina_Bool eina_rectangles_intersect (const Eina_Rectangle *r1, const Eina_Rectangle *r2)
 Check if the given rectangles intersect.
static Eina_Bool eina_rectangle_xcoord_inside (const Eina_Rectangle *r, int x)
 Check if the given x-coordinate is in the rectangle .
static Eina_Bool eina_rectangle_ycoord_inside (const Eina_Rectangle *r, int y)
 Check if the given y-coordinate is in the rectangle .
static Eina_Bool eina_rectangle_coords_inside (const Eina_Rectangle *r, int x, int y)
 Check if the given point is in the rectangle .
static void eina_rectangle_union (Eina_Rectangle *dst, const Eina_Rectangle *src)
 Get the union of two rectangles.
static Eina_Bool eina_rectangle_intersection (Eina_Rectangle *dst, const Eina_Rectangle *src)
 Get the intersection of two rectangles.
static void eina_rectangle_rescale_in (const Eina_Rectangle *out, const Eina_Rectangle *in, Eina_Rectangle *res)
 Rescale the coordinates from rectangle as if it where relative to rectangle.
static void eina_rectangle_rescale_out (const Eina_Rectangle *out, const Eina_Rectangle *in, Eina_Rectangle *res)
 Rescale the coordinates from rectangle as if it where relative to rectangle.
Eina_Rectangle_Pooleina_rectangle_pool_new (int w, int h)
 Add a rectangle in a new pool.
Eina_Rectangle_Pooleina_rectangle_pool_get (Eina_Rectangle *rect)
 Return the pool of the given rectangle.
Eina_Bool eina_rectangle_pool_geometry_get (Eina_Rectangle_Pool *pool, int *w, int *h)
 Return the width and height of the given pool.
void * eina_rectangle_pool_data_get (Eina_Rectangle_Pool *pool)
 Get the data from the given pool.
void eina_rectangle_pool_data_set (Eina_Rectangle_Pool *pool, const void *data)
 Set the data to the given pool.
void eina_rectangle_pool_free (Eina_Rectangle_Pool *pool)
 Free the given pool.
int eina_rectangle_pool_count (Eina_Rectangle_Pool *pool)
 Return the number of rectangles in the given pool.
Eina_Rectangleeina_rectangle_pool_request (Eina_Rectangle_Pool *pool, int w, int h)
 Request a rectangle of given size in the given pool.
void eina_rectangle_pool_release (Eina_Rectangle *rect)
 Remove the given rectangle from the pool.
Eina_Rectangleeina_rectangle_new (int x, int y, int w, int h)
 Create a new rectangle.
void eina_rectangle_free (Eina_Rectangle *rect)
 Free the given rectangle.
void eina_rectangle_pool_packing_set (Eina_Rectangle_Pool *pool, Eina_Rectangle_Packing type)
 Sets the type of given rectangle pool.

Typedefs

typedef struct _Eina_Rectangle Eina_Rectangle
typedef struct _Eina_Rectangle_Pool Eina_Rectangle_Pool

Defines

#define EINA_RECTANGLE_SET(Rectangle, X, Y, W, H)
 Macro to set the values of a Eina_Rectangle.

These functions provide rectangle management.


Define Documentation

#define EINA_RECTANGLE_SET (   Rectangle,
  X,
  Y,
  W,
 
)
Value:
{                         \
      (Rectangle)->x = X;             \
      (Rectangle)->y = Y;             \
      (Rectangle)->w = W;             \
      (Rectangle)->h = H;             \
    }

Macro to set the values of a Eina_Rectangle.

Parameters:
RectangleThe rectangle to set the values.
XThe X coordinate of the top left corner of the rectangle.
YThe Y coordinate of the top left corner of the rectangle.
WThe width of the rectangle.
HThe height of the rectangle.

This macro set the values of Rectangle. (X, Y) is the coordinates of the top left corner of Rectangle, W is its width and H is its height.


Typedef Documentation

Simple rectangle structure.

Type for an opaque pool of rectangle.


Enumeration Type Documentation

Enumerator:
Eina_Packing_Descending 

Current

Eina_Packing_Ascending 

sorting in assending order

Eina_Packing_Bottom_Left 

sorting in bottemleft fasion

Eina_Packing_Bottom_Left_Skyline 

bottemleft skyline

Eina_Packing_Bottom_Left_Skyline_Improved 

optimized bottemleft skyline


Function Documentation

static void eina_rectangle_coords_from ( Eina_Rectangle r,
int  x,
int  y,
int  w,
int  h 
) [static]

Set the coordinates and size of the given rectangle.

Since :
2.3
Parameters:
[in]rThe rectangle.
[in]xThe top-left x coordinate of the rectangle.
[in]yThe top-left y coordinate of the rectangle.
[in]wThe width of the rectangle.
[in]hThe height of the rectangle.
Remarks:
This function sets its top-left x coordinate to x, its top-left y coordinate to y, its width to w and its height to h. No check is done on r, so it must be a valid rectangle.
static Eina_Bool eina_rectangle_coords_inside ( const Eina_Rectangle r,
int  x,
int  y 
) [static]

Check if the given point is in the rectangle .

Since :
2.3
Parameters:
[in]rThe rectangle.
[in]xThe x coordinate of the point.
[in]yThe y coordinate of the point.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Remarks:
This function returns EINA_TRUE if the point of coordinate (x, y) is in r, EINA_FALSE otherwise. No check is done on r, so it must be a valid rectangle.

Free the given rectangle.

Since :
2.3
Parameters:
[in]rectThe rectangle to free.
Remarks:
This function removes rect from the rectangles pool.
static Eina_Bool eina_rectangle_intersection ( Eina_Rectangle dst,
const Eina_Rectangle src 
) [static]

Get the intersection of two rectangles.

Since :
2.3
Parameters:
[in]dstThe first rectangle.
[in]srcThe second rectangle.
Returns:
EINA_TRUE if the rectangles intersect, EINA_FALSE otherwise.
Remarks:
This function get the intersection of the rectangles dst and src. The result is stored in dst. No check is done on dst or src, so they must be valid rectangles.
static Eina_Bool eina_rectangle_is_empty ( const Eina_Rectangle r) [static]

Check if the given rectangle is empty.

Since :
2.3
Parameters:
[in]rThe rectangle to check.
Returns:
EINA_TRUE if the rectangle is empty, EINA_FALSE otherwise.
Remarks:
This function returns EINA_TRUE if r is empty, EINA_FALSE otherwise. No check is done on r, so it must be a valid rectangle.
Eina_Rectangle* eina_rectangle_new ( int  x,
int  y,
int  w,
int  h 
)

Create a new rectangle.

Since :
2.3
Parameters:
[in]xThe X coordinate of the top left corner of the rectangle.
[in]yThe Y coordinate of the top left corner of the rectangle.
[in]wThe width of the rectangle.
[in]hThe height of the rectangle.
Returns:
The new rectangle on success, @ NULL otherwise.
Remarks:
This function creates a rectangle which top left corner has the coordinates (x, y), with height w and height h and adds it to the rectangles pool. No check is done on w and h. This function returns a new rectangle on success, NULL otherwhise.

Return the number of rectangles in the given pool.

Since :
2.3
Parameters:
[in]poolThe pool.
Returns:
The number of rectangles in the pool.
Remarks:
This function returns the number of rectangles in pool.

Get the data from the given pool.

Since :
2.3
Parameters:
[in]poolThe pool.
Returns:
The returned data.
Remarks:
This function gets the data from pool set by eina_rectangle_pool_data_set(). If pool is NULL, this function returns NULL.
void eina_rectangle_pool_data_set ( Eina_Rectangle_Pool pool,
const void *  data 
)

Set the data to the given pool.

Since :
2.3
Parameters:
[in]poolThe pool.
[in]dataThe data to set.
Remarks:
This function sets data to pool. If pool is NULL, this function does nothing.

Free the given pool.

Since :
2.3
Parameters:
[in]poolThe pool to free.
Remarks:
This function frees the allocated data of pool. If pool is NULL, this function returned immediately.
Eina_Bool eina_rectangle_pool_geometry_get ( Eina_Rectangle_Pool pool,
int *  w,
int *  h 
)

Return the width and height of the given pool.

Since :
2.3
Parameters:
[in]poolThe pool.
[out]wThe returned width.
[out]hThe returned height.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Remarks:
This function returns the width and height of pool and store them in respectively w and h if they are not NULL. If pool is NULL, EINA_FALSE is returned. Otherwise EINA_TRUE is returned.

Return the pool of the given rectangle.

Since :
2.3
Parameters:
[in]rectThe rectangle.
Returns:
The pool of the given rectangle.
Remarks:
This function returns the pool in which rect is. If rect is NULL, NULL is returned.

Add a rectangle in a new pool.

Since :
2.3
Parameters:
[in]wThe width of the rectangle.
[in]hThe height of the rectangle.
Returns:
A newly allocated pool on success, NULL otherwise.
Remarks:
This function adds the rectangle of size (width, height) to a new pool. If the pool can not be created, NULL is returned. Otherwise the newly allocated pool is returned.

Sets the type of given rectangle pool.

Since :
2.3
Parameters:
[in]poolThe rectangle pool for which type is to be set.
Remarks:
This function sets type of pool.
See also:
Eina_Rectangle_Packing
Since (EFL) :
1.11

Remove the given rectangle from the pool.

Since :
2.3
Parameters:
[in]rectThe rectangle to remove from the pool.
Remarks:
This function removes rect from the pool. If rect is NULL, the function returns immediately. Otherwise it removes rect from the pool.

Request a rectangle of given size in the given pool.

Since :
2.3
Parameters:
[in]poolThe pool.
[in]wThe width of the rectangle to request.
[in]hThe height of the rectangle to request.
Returns:
The requested rectangle on success, NULL otherwise.
Remarks:
This function retrieve from pool the rectangle of width w and height h. If pool is NULL, or w or h are non-positive, the function returns NULL. If w or h are greater than the pool size, the function returns NULL. On success, the function returns the rectangle which matches the size (w, h). Otherwise it returns NULL.
static void eina_rectangle_rescale_in ( const Eina_Rectangle out,
const Eina_Rectangle in,
Eina_Rectangle res 
) [static]

Rescale the coordinates from rectangle as if it where relative to rectangle.

Since :
2.3
Parameters:
[in]outThe outer rectangle.
[in]inThe inner rectangle.
[out]resThe resulting rectangle.
static void eina_rectangle_rescale_out ( const Eina_Rectangle out,
const Eina_Rectangle in,
Eina_Rectangle res 
) [static]

Rescale the coordinates from rectangle as if it where relative to rectangle.

Since :
2.3
Parameters:
[in]outThe outer rectangle.
[in]inThe inner rectangle.
[out]resThe resulting rectangle.
static void eina_rectangle_union ( Eina_Rectangle dst,
const Eina_Rectangle src 
) [static]

Get the union of two rectangles.

Since :
2.3
Parameters:
[in]dstThe first rectangle.
[in]srcThe second rectangle.
Remarks:
This function get the union of the rectangles dst and src. The result is stored in dst. No check is done on dst or src, so they must be valid rectangles.
static Eina_Bool eina_rectangle_xcoord_inside ( const Eina_Rectangle r,
int  x 
) [static]

Check if the given x-coordinate is in the rectangle .

Since :
2.3
Parameters:
[in]rThe rectangle.
[in]xThe x coordinate.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Remarks:
This function returns EINA_TRUE if x is in r with respect to the horizontal direction, EINA_FALSE otherwise. No check is done on r, so it must be a valid rectangle.
static Eina_Bool eina_rectangle_ycoord_inside ( const Eina_Rectangle r,
int  y 
) [static]

Check if the given y-coordinate is in the rectangle .

Since :
2.3
Parameters:
[in]rThe rectangle.
[in]yThe y coordinate.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Remarks:
This function returns EINA_TRUE if y is in r with respect to the vertical direction, EINA_FALSE otherwise. No check is done on r, so it must be a valid rectangle.
static Eina_Bool eina_rectangles_intersect ( const Eina_Rectangle r1,
const Eina_Rectangle r2 
) [static]

Check if the given rectangles intersect.

Since :
2.3
Parameters:
[in]r1The first rectangle.
[in]r2The second rectangle.
Returns:
EINA_TRUE if the rectangles intersect, EINA_FALSE otherwise.
Remarks:
This function returns EINA_TRUE if r1 and r2 intersect, EINA_FALSE otherwise. No check is done on r1 and r2, so they must be valid rectangles.
static int eina_spans_intersect ( int  c1,
int  l1,
int  c2,
int  l2 
) [static]

Check if the given spans intersect.

Since :
2.3
Parameters:
[in]c1The column of the first span.
[in]l1The length of the first span.
[in]c2The column of the second span.
[in]l2The length of the second span.
Returns:
EINA_TRUE on success, EINA_FALSE otherwise.
Remarks:
This function returns EINA_TRUE if the given spans intersect, EINA_FALSE otherwise.