summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_rectangle.h
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2020-05-08 10:19:40 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2020-05-08 12:32:09 +0200
commit88d1c886bd2bc47b5eaeaac4b15ae9434103bdf2 (patch)
tree8bcfefd55e5dd2ff467533481340613703310594 /src/lib/eina/eina_rectangle.h
parent5f159ae624bbe4211c50e1122756c341c437656a (diff)
doxygen docs: Complete docs for Eina_Rectangle
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_rectangle.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/lib/eina/eina_rectangle.h b/src/lib/eina/eina_rectangle.h
index 4a92940c28..0c0a92bd47 100644
--- a/src/lib/eina/eina_rectangle.h
+++ b/src/lib/eina/eina_rectangle.h
@@ -39,15 +39,24 @@
39 * @{ 39 * @{
40 */ 40 */
41 41
42/** A zero-size rectangle. */
42#define EINA_RECTANGLE_INIT { 0, 0, 0, 0} 43#define EINA_RECTANGLE_INIT { 0, 0, 0, 0}
44/** A format string useful for printf-like functions. */
43#define EINA_RECTANGLE_FORMAT "dx%d - %dx%d" 45#define EINA_RECTANGLE_FORMAT "dx%d - %dx%d"
46/** Separates the components of the rectangle structure into a comma-separated list,
47 * so they can be used as parameters. */
44#define EINA_RECTANGLE_ARGS(r) (r)->x, (r)->y, (r)->w, (r)->h 48#define EINA_RECTANGLE_ARGS(r) (r)->x, (r)->y, (r)->w, (r)->h
45 49
50/** Creates an instance of an #Eina_Rect */
46#define EINA_RECT(x, y, w, h) ((Eina_Rect) { { (x), (y), (w), (h) } }) 51#define EINA_RECT(x, y, w, h) ((Eina_Rect) { { (x), (y), (w), (h) } })
52/** A zero-size rectangle that can be used to initialize #Eina_Rect structures. */
47#define EINA_RECT_ZERO() { EINA_RECTANGLE_INIT } 53#define EINA_RECT_ZERO() { EINA_RECTANGLE_INIT }
54/** A zero-size rectangle that can be used to initialize #Eina_Rect structures. */
48#define EINA_RECT_EMPTY() ((Eina_Rect) EINA_RECT_ZERO()) 55#define EINA_RECT_EMPTY() ((Eina_Rect) EINA_RECT_ZERO())
49 56
57/** Creates an instance of an #Eina_Position2D */
50#define EINA_POSITION2D(x, y) ((Eina_Position2D) { (x), (y) }) 58#define EINA_POSITION2D(x, y) ((Eina_Position2D) { (x), (y) })
59/** Creates an instance of an #Eina_Size2D */
51#define EINA_SIZE2D(x, y) ((Eina_Size2D) { (x), (y) }) 60#define EINA_SIZE2D(x, y) ((Eina_Size2D) { (x), (y) })
52 61
53/** @brief A 2D position in pixel coordinates */ 62/** @brief A 2D position in pixel coordinates */
@@ -104,15 +113,22 @@ typedef struct _Eina_Rectangle
104 int h; /**< height of rectangle */ 113 int h; /**< height of rectangle */
105} Eina_Rectangle; 114} Eina_Rectangle;
106 115
116/**
117 * @typedef Eina_Rect
118 * A convenient rectangle structure which can be accessed in different ways.
119 */
107typedef union _Eina_Rect 120typedef union _Eina_Rect
108{ 121{
109 Eina_Rectangle rect; 122 Eina_Rectangle rect; /**< Embedded simple rectangle structure */
110 struct { 123 struct {
111 Eina_Position2D pos; 124 Eina_Position2D pos; /**< Top-left corner in pixels */
112 Eina_Size2D size; 125 Eina_Size2D size; /**< Size in pixels */
113 }; 126 };
114 struct { 127 struct {
115 int x, y, w, h; 128 int x; /**< Top-left x coordinate of rectangle */
129 int y; /**< Top-left y coordinate of rectangle */
130 int w; /**< Width of rectangle */
131 int h; /**< Height of rectangle */
116 }; 132 };
117} Eina_Rect; 133} Eina_Rect;
118 134
@@ -141,10 +157,10 @@ typedef enum {
141 * @since 1.19 157 * @since 1.19
142 */ 158 */
143typedef enum { 159typedef enum {
144 EINA_RECTANGLE_OUTSIDE_TOP = 1, 160 EINA_RECTANGLE_OUTSIDE_TOP = 1, /**< Position is over the rectangle */
145 EINA_RECTANGLE_OUTSIDE_LEFT = 2, 161 EINA_RECTANGLE_OUTSIDE_LEFT = 2, /**< Position is to the left of the rectangle */
146 EINA_RECTANGLE_OUTSIDE_BOTTOM = 4, 162 EINA_RECTANGLE_OUTSIDE_BOTTOM = 4, /**< Position is below the rectangle */
147 EINA_RECTANGLE_OUTSIDE_RIGHT = 8 163 EINA_RECTANGLE_OUTSIDE_RIGHT = 8 /**< Position is to the right of the rectangle */
148} Eina_Rectangle_Outside; 164} Eina_Rectangle_Outside;
149 165
150 166
@@ -527,6 +543,10 @@ EAPI void eina_rectangle_pool_release(Eina_Rectangle *rect) EINA
527 (Rectangle)->h = H; \ 543 (Rectangle)->h = H; \
528 } 544 }
529 545
546/**
547 * @def EINA_RECT_SET
548 * Functionally equivalent to #EINA_RECTANGLE_SET
549 */
530#define EINA_RECT_SET(rect, x, y, w, h) do { EINA_RECTANGLE_SET((&rect), x, y, w, h) } while (0) 550#define EINA_RECT_SET(rect, x, y, w, h) do { EINA_RECTANGLE_SET((&rect), x, y, w, h) } while (0)
531 551
532 552