Differences From Artifact [3a0e0599cf]:
- File src/OFObject.h — part of check-in [dccc3ed8a9] at 2014-05-31 16:34:25 on branch trunk — Work around broken Apple libc headers (user: js, size: 29242) [annotate] [blame] [check-ins using]
To Artifact [94f4198362]:
- File
src/OFObject.h
— part of check-in
[13ee56edf3]
at
2014-06-21 21:43:43
on branch trunk
— Move all macros from OFObject.h to macros.h
This means that OFObject.h imports macros.h now, making it unnecessary
to manually import macros.h in almost every file. And while at it, also
import autorelease.h in OFObject.h, so that this doesn't need to be
manually imported in almost every file as well. (user: js, size: 26570) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 | #endif #include <stddef.h> #include <stdint.h> #include <stdbool.h> #include <limits.h> | < | < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #endif #include <stddef.h> #include <stdint.h> #include <stdbool.h> #include <limits.h> #import "macros.h" #import "autorelease.h" /*! @file */ /*! * @brief A result of a comparison. */ typedef enum { /*! The left object is smaller than the right */ OF_ORDERED_ASCENDING = -1, /*! Both objects are equal */ |
︙ | ︙ | |||
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | */ typedef struct { /*! The start of the range */ size_t location; /*! The length of the range */ size_t length; } of_range_t; /*! * @brief A time interval in seconds. */ typedef double of_time_interval_t; /*! * @struct of_point_t OFObject.h ObjFW/OFObject.h * * @brief A point. */ typedef struct { /*! The x coordinate of the point */ float x; /*! The y coordinate of the point */ float y; } of_point_t; /*! * @struct of_dimension_t OFObject.h ObjFW/OFObject.h * * @brief A dimension. */ typedef struct { /*! The width of the dimension */ float width; /*! The height of the dimension */ float height; } of_dimension_t; /*! * @struct of_rectangle_t OFObject.h ObjFW/OFObject.h * * @brief A rectangle. */ typedef struct { /*! The point from where the rectangle originates */ of_point_t origin; /*! The size of the rectangle */ of_dimension_t size; } of_rectangle_t; @class OFString; @class OFThread; /*! * @protocol OFObject OFObject.h ObjFW/OFObject.h * | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | */ typedef struct { /*! The start of the range */ size_t location; /*! The length of the range */ size_t length; } of_range_t; /*! * @brief Creates a new of_range_t. * * @param start The starting index of the range * @param length The length of the range * @return An of_range with the specified start and length */ static OF_INLINE of_range_t OF_CONST_FUNC of_range(size_t start, size_t length) { of_range_t range = { start, length }; return range; } /*! * @brief A time interval in seconds. */ typedef double of_time_interval_t; /*! * @struct of_point_t OFObject.h ObjFW/OFObject.h * * @brief A point. */ typedef struct { /*! The x coordinate of the point */ float x; /*! The y coordinate of the point */ float y; } of_point_t; /*! * @brief Creates a new of_point_t. * * @param x The x coordinate of the point * @param y The x coordinate of the point * @return An of_point_t with the specified coordinates */ static OF_INLINE of_point_t OF_CONST_FUNC of_point(float x, float y) { of_point_t point = { x, y }; return point; } /*! * @struct of_dimension_t OFObject.h ObjFW/OFObject.h * * @brief A dimension. */ typedef struct { /*! The width of the dimension */ float width; /*! The height of the dimension */ float height; } of_dimension_t; /*! * @brief Creates a new of_dimension_t. * * @param width The width of the dimension * @param height The height of the dimension * @return An of_dimension_t with the specified width and height */ static OF_INLINE of_dimension_t OF_CONST_FUNC of_dimension(float width, float height) { of_dimension_t dimension = { width, height }; return dimension; } /*! * @struct of_rectangle_t OFObject.h ObjFW/OFObject.h * * @brief A rectangle. */ typedef struct { /*! The point from where the rectangle originates */ of_point_t origin; /*! The size of the rectangle */ of_dimension_t size; } of_rectangle_t; /*! * @brief Creates a new of_rectangle_t. * * @param x The x coordinate of the top left corner of the rectangle * @param y The y coordinate of the top left corner of the rectangle * @param width The width of the rectangle * @param height The height of the rectangle * @return An of_rectangle_t with the specified origin and size */ static OF_INLINE of_rectangle_t OF_CONST_FUNC of_rectangle(float x, float y, float width, float height) { of_rectangle_t rectangle = { of_point(x, y), of_dimension(width, height) }; return rectangle; } @class OFString; @class OFThread; /*! * @protocol OFObject OFObject.h ObjFW/OFObject.h * |
︙ | ︙ |